Skip to content

Commit 4b53d39

Browse files
author
Jorge Aparicio
committed
prepare for releases
1 parent 010f3c4 commit 4b53d39

File tree

15 files changed

+233
-40
lines changed

15 files changed

+233
-40
lines changed

.travis.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,61 @@
11
cache: cargo
22
dist: trusty
3-
env: TARGET=x86_64-unknown-linux-gnu
43
language: rust
5-
rust: nightly-2016-09-30
4+
rust: stable
65
services: docker
76
sudo: required
87

8+
env:
9+
global:
10+
- CRATE_NAME=svd2rust
11+
- TARGET=x86_64-unknown-linux-gnu
12+
13+
matrix:
14+
include:
15+
# OSX
16+
- env: TARGET=i686-apple-darwin
17+
os: osx
18+
- env: TARGET=x86_64-apple-darwin
19+
os: osx
20+
21+
# Linux
22+
- env: TARGET=i686-unknown-linux-gnu
23+
- env: TARGET=i686-unknown-linux-musl
24+
- env: TARGET=x86_64-unknown-linux-musl
25+
26+
install:
27+
# `std for cross-compilation
28+
- curl https://static.rust-lang.org/rustup.sh |
29+
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`
30+
931
script:
1032
- cargo generate-lockfile
11-
- sh ci/run-docker.sh $TARGET
33+
- if [[ $TRAVIS_OS_NAME = linux ]]; then
34+
sh ci/run-docker.sh $TARGET;
35+
else
36+
sh ci/run.sh;
37+
fi
1238
# Travis can't cache files that are not readable by "others"
1339
- chmod -R a+r $HOME/.cargo
1440

41+
before_deploy:
42+
- sh ci/package.sh $TARGET
43+
44+
deploy:
45+
provider: releases
46+
api_key:
47+
secure: b+q2Uul+hA1OyFbfWaQTF02xwZNTl5x8uumHkx7eeZZYtrXZh8aKyMgUiCVbcdch+p8r0QqvGYXyHUqtCmeFzLrFiudoleQBojs+0Pbrfnw5PH93k4Bf2snOJu6Sp5xjl5X34C+eM/hT3vIrAmEZCXFwVG7piZsdXWBdvkudz6pit8R2hsa6uxbyCs2lXmS/aWHSygg25DtrP/cezILxwS0VtXwgFOUTn8AQMd4bZeEz6ezTcUuCKEHdC9SUmFiNIwR7rjVzL4+Z7ffOz3TF4UHyTa+DLRM4pIO4L/DH+G2KJ3kw2C/98tLGwyObYChwiKXY1lW+bjauD38rwIMpzbAEAx+oPZQNLwdLXjIk9ZN9K3Dm0yWs5aZC+8O7QiOgxMTA3zQmZJdSRpnHLZJKns8hmxOyVeGr+RlTt+sJXqErgN8yzUSdn918kTbAqvc1x0zb/eC+wAx7ULvgjGmO6AuWZWRVM6SrXoKjANUCH1OdkpFA7T0pZ3Nx4p503234hKFyIoS/sd1I17bcBElP59zdv/NlpBAndxRdzPk/V2W40736xxLdQWgRgTMP95+/AJmsf8orscVag/wOdN4ACmwdAi6YxZB+bO9mMzuLJ8Z9BoudGqzaw3uCxkNNQSn+KJ+MrkhBnct7TnDPuAhy4pAOtmwgW3PTPrxsiNQQw+4=
48+
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.*
49+
# don't delete the target directory
50+
skip_cleanup: true
51+
on:
52+
condition: $TRAVIS_RUST_VERSION = stable
53+
tags: true
54+
1555
branches:
1656
only:
57+
# Release tags
58+
- /^v\d+\.\d+\.\d+.*$/
1759
- auto
1860
- try
1961

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[package]
22
authors = ["Jorge Aparicio <[email protected]>"]
3-
build = "build.rs"
43
name = "svd2rust"
54
version = "0.1.0"
65

appveyor.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
environment:
2+
global:
3+
CRATE_NAME: svd2rust
4+
RUST_VERSION: nightly
5+
matrix:
6+
- TARGET: i686-pc-windows-gnu
7+
- TARGET: i686-pc-windows-msvc
8+
- TARGET: x86_64-pc-windows-gnu
9+
- TARGET: x86_64-pc-windows-msvc
10+
11+
install:
12+
- ps: ci\install.ps1
13+
14+
build: false
15+
16+
test_script:
17+
- if [%APPVEYOR_REPO_TAG%]==[false] (
18+
cargo build --target %TARGET%
19+
) else (
20+
cargo rustc --target %TARGET% --release --bin svd2rust -- -C lto
21+
)
22+
23+
before_deploy:
24+
- ps: ci\package.ps1
25+
26+
deploy:
27+
description: 'Windows release'
28+
artifact: /.*\.zip/
29+
auth_token:
30+
secure: bQ29dEXeNG5VP2hQcWiZ1xsfmkGosteCDNeYu/cXTX4lOeghOp0qANpQXmGfal29
31+
provider: GitHub
32+
on:
33+
RUST_VERSION: nightly
34+
appveyor_repo_tag: true
35+
36+
cache:
37+
- C:\Users\appveyor\.cargo\registry
38+
- target
39+
40+
branches:
41+
only:
42+
# Release tags
43+
- /^v\d+\.\d+\.\d+.*$/
44+
- auto
45+
- try
46+
47+
notifications:
48+
- provider: Email
49+
on_build_success: false

build.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM ubuntu:12.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates \
5+
curl \
6+
gcc-multilib
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates \
5+
curl \
6+
gcc-multilib \
7+
musl-tools
8+
ENV CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
9+
CC_i686_unknown_linux_musl=musl-gcc

ci/docker/x86_64-unknown-linux-gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:12.04
22
RUN apt-get update
33
RUN apt-get install -y --no-install-recommends \
44
ca-certificates \
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates \
5+
curl \
6+
gcc \
7+
libc6-dev \
8+
musl-tools

ci/install.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
$Env:HOST = $Env:TARGET
2+
3+
If ($Env:TARGET -Match 'gnu') {
4+
if ($Env:TARGET -Match 'x86_64') {
5+
$Env:PATH += ';C:\msys64\mingw64\bin'
6+
} else {
7+
$Env:PATH += ';C:\msys64\mingw32\bin'
8+
}
9+
} ElseIf ($Env:TARGET -Match 'i586') {
10+
$Env:HOST = 'i686-pc-windows-msvc'
11+
}
12+
13+
[Net.ServicePointManager]::SecurityProtocol = 'Ssl3, Tls, Tls12'
14+
Start-FileDownload 'https://win.rustup.rs' 'rustup-init.exe'
15+
16+
.\rustup-init --default-host $Env:HOST --default-toolchain $Env:RUST_VERSION -y
17+
18+
$Env:PATH = 'C:\Users\appveyor\.cargo\bin;' + $Env:PATH
19+
20+
If ($Env:TARGET -ne $Env:HOST) {
21+
rustup target add $Env:TARGET
22+
}
23+
24+
rustc -Vv
25+
26+
cargo -V

ci/package.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$SRC_DIR = $PWD.Path
2+
$STAGE = [System.Guid]::NewGuid().ToString()
3+
4+
Set-Location $ENV:Temp
5+
New-Item -Type Directory -Name $STAGE
6+
Set-Location $STAGE
7+
8+
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
9+
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\svd2rust.exe" '.\'
10+
7z a "$ZIP" *
11+
12+
Push-AppveyorArtifact "$ZIP"
13+
14+
Remove-Item *.* -Force
15+
Set-Location ..
16+
Remove-Item $STAGE
17+
Set-Location $SRC_DIR

0 commit comments

Comments
 (0)