Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 2172d7a

Browse files
committed
ci: switch to Trust v0.1.2
1 parent 8b74603 commit 2172d7a

File tree

13 files changed

+131
-178
lines changed

13 files changed

+131
-178
lines changed

.travis.yml

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,67 @@
1-
cache: cargo
1+
# Based on the "trust" template v0.1.2
2+
# https://github.com/japaric/trust/tree/v0.1.2
3+
24
dist: trusty
3-
language: generic
45
language: rust
5-
rust: stable
66
services: docker
77
sudo: required
88

99
env:
1010
global:
1111
- CRATE_NAME=itm
12-
- DEPLOY_VERSION=stable
13-
- TARGET=x86_64-unknown-linux-gnu
1412

1513
matrix:
14+
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
15+
# don't need
1616
include:
17+
# Linux
18+
- env: TARGET=i686-unknown-linux-gnu
19+
- env: TARGET=i686-unknown-linux-musl
20+
- env: TARGET=x86_64-unknown-linux-gnu
21+
- env: TARGET=x86_64-unknown-linux-musl
22+
1723
# OSX
1824
- env: TARGET=i686-apple-darwin
1925
os: osx
2026
- env: TARGET=x86_64-apple-darwin
2127
os: osx
2228

23-
# Linux
24-
- env: TARGET=i686-unknown-linux-gnu
25-
- env: TARGET=i686-unknown-linux-musl
26-
# This target is handled by the default build job
27-
# - env: TARGET=x86_64-unknown-linux-gnu
28-
- env: TARGET=x86_64-unknown-linux-musl
29+
before_install:
30+
- set -e
31+
- rustup self update
2932

3033
install:
31-
# curl: cargo + rustc
32-
# case: rust-std
33-
- if [ -z $TRAVIS_TAG ] || [ $TRAVIS_RUST_VERSION = $DEPLOY_VERSION ]; then
34-
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y;
35-
source ~/.cargo/env;
36-
case $TARGET in
37-
x86_64-apple-darwin | x86_64-unknown-linux-gnu) ;;
38-
*) rustup target add $TARGET ;;
39-
esac;
40-
fi
34+
- sh ci/install.sh
35+
- source ~/.cargo/env || true
4136

4237
script:
43-
# chmod: Travis can't cache files that are not readable by "others"
44-
- if [ -z $TRAVIS_TAG ] || [ $TRAVIS_RUST_VERSION = $DEPLOY_VERSION ]; then
45-
cargo generate-lockfile;
38+
- bash ci/script.sh
4639

47-
if [[ $TRAVIS_OS_NAME = linux ]]; then
48-
sh ci/run-docker.sh $TARGET || exit 1;
49-
else
50-
sh ci/run.sh || exit 1;
51-
fi;
52-
53-
chmod -R a+r $HOME/.cargo;
54-
fi
40+
after_script: set +e
5541

5642
before_deploy:
57-
- sh ci/package.sh $TARGET
43+
- sh ci/before_deploy.sh
5844

5945
deploy:
60-
provider: releases
6146
api_key:
62-
secure: Muel87WKuZAv4Fc1QRc4LF2OQpbfdCkvZupA1ik/mBEHxbr8qpBJDLbq1BgNo6XB6RFjOglPEsf1yhxMwMdaNVymQOTTEbMZ29FAsthoH5F/PPpuMWTRB1DXqvwT9AzTaQhKmT1u4ZSxPpLqAOV0tT5Tdm3grSRt9UVlvSBjYo8A+KLWjPVOX88o7MLdbqHWQ8IbeS7nmrhO4eOXk4wgemDLdUPENhrHQb52oetMsaW+W3CZLkyNIYkQAZGpz2Vug1YrZMe+8heGDBuSAPBi0hI5Z9qYNN2Zpcp24XzVrr5KerKNwElPBbx5VyzX2bG1lkyKujRrt3Xl24xf4q0hZLYisTS2Cq5wNbIUvrVGc/y1UQ2sS2NRyVylMi5jryHBmqTc7TLvLrrXP/0SmxO6PeWoKMwcfLIbGmHWqtmp9Qo7hIqruSK6v+myNgUFmbyVsJlsB1Upo3eQ69B4XcG3uOD5kwvzo57lyzLxXDnvQk/v1Ygab8lFBeNr8dBiA3+RTaVblXSFKY1cQlPdg/AzkEXcz6xKda7y3gz530cgxL9f2Kx0YRwi6Bh9jBEA52CHFUF7UDiyPmGE+6rcYhpqIwvZ2nDQwLnxu+pV620ttYoXqK5FYDxPAVWuSe3A/F4KZzgAse0FFg0moOZTcurcrRSQfPT3EVqTO8xZi+Ou+kw=
47+
secure: 1DhCSm5VHF9WKDqfpfAQZJDlUC7radCwsRpa8MEGbWTOYc0J5ZMV1ZCd20M1JDGVJO5cT5Eopo/eiB33qb/cppiFOGZYOSRgCRmwUHSmWWKR4xIzowlkgBk2/eXntYuP88EwQyw4u4cblT6KoicgBA3niuWuFQFN+yjgvbrq5JSaziuQwHvqc4R+OrKLjsJKc7/OK7O+hLjzGMZVvwgvg0NDiVjACUVzRnnr2ONs+gbr/pYXTVjG7tafX9xfzb+bjmAj9W6ID4Fgn20R7S/id6/Iqd53BG/tmstJ33tuC7didV5o1FDblRwqjw7r4lMknIhfNpRLQFAPcQhukssteDIrKwVA/XTDlvqKSEV417XSOILDWupdmri/OhhEH8GjHL3JaK8BFDep5E4j2Sx4Ee8XHDh7Lmx0Tdi4tm491CNGtHDfNc2fhpGpi8hTvA+KDR85Xyd/JbNsIi0faT4zUGWfdjgm60XVhSUviAaeBUdav+wX51PkiF2Am8Io/IEDNCtZ6CsO37qnUMG/5hQ5SeIlXlc0rAY3Qp8H5PpztZkXYXB0/w3yGS70Y9r60QQZeqQt64/qdFuvTNCF8vbEEXzE1WMoT+/ou+ITwXeGb7BWekJpRCG9qla/ro1Z7yIHBft6qYcqh4+kxIdKbWvLwq12epy1xrH585jawpg524E=
6348
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.*
64-
# don't delete the target directory
65-
skip_cleanup: true
6649
on:
67-
condition: $TRAVIS_RUST_VERSION = $DEPLOY_VERSION
50+
condition: $TRAVIS_RUST_VERSION = stable
6851
tags: true
52+
provider: releases
53+
skip_cleanup: true
6954

70-
cache:
71-
directories:
72-
- $HOME/.cargo
73-
- target
55+
cache: cargo
56+
before_cache:
57+
# Travis can't cache files that are not readable by "others"
58+
- chmod -R a+r $HOME/.cargo
7459

7560
branches:
7661
only:
77-
# Release tags
62+
# release tags
7863
- /^v\d+\.\d+\.\d+.*$/
79-
- auto
80-
- try
64+
- master
8165

8266
notifications:
8367
email:

ci/package.ps1 renamed to ci/before_deploy.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This script takes care of packaging the build artifacts that will go in the
2+
# release zipfile
3+
14
$SRC_DIR = $PWD.Path
25
$STAGE = [System.Guid]::NewGuid().ToString()
36

@@ -6,7 +9,9 @@ New-Item -Type Directory -Name $STAGE
69
Set-Location $STAGE
710

811
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
12+
913
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\itmdump.exe" '.\'
14+
1015
7z a "$ZIP" *
1116

1217
Push-AppveyorArtifact "$ZIP"

ci/before_deploy.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This script takes care of building your crate and packaging it for release
2+
3+
set -ex
4+
5+
main() {
6+
local src=$(pwd) \
7+
stage=
8+
9+
case $TRAVIS_OS_NAME in
10+
linux)
11+
stage=$(mktemp -d)
12+
;;
13+
osx)
14+
stage=$(mktemp -d -t tmp)
15+
;;
16+
esac
17+
18+
test -f Cargo.lock || cargo generate-lockfile
19+
20+
cross rustc --bin itmdump --target $TARGET --release -- -C lto
21+
22+
cp target/$TARGET/release/itmdump $stage/
23+
24+
cd $stage
25+
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
26+
cd $src
27+
28+
rm -rf $stage
29+
}
30+
31+
main

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

Lines changed: 0 additions & 6 deletions
This file was deleted.

ci/docker/i686-unknown-linux-musl/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

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

Lines changed: 0 additions & 7 deletions
This file was deleted.

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

Lines changed: 0 additions & 8 deletions
This file was deleted.

ci/install.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.

ci/install.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
set -ex
2+
3+
main() {
4+
local target=
5+
if [ $TRAVIS_OS_NAME = linux ]; then
6+
target=x86_64-unknown-linux-musl
7+
sort=sort
8+
else
9+
target=x86_64-apple-darwin
10+
sort=gsort # for `sort --sort-version`, from brew's coreutils.
11+
fi
12+
13+
# Builds for iOS are done on OSX, but require the specific target to be
14+
# installed.
15+
case $TARGET in
16+
aarch64-apple-ios)
17+
rustup target install aarch64-apple-ios
18+
;;
19+
armv7-apple-ios)
20+
rustup target install armv7-apple-ios
21+
;;
22+
armv7s-apple-ios)
23+
rustup target install armv7s-apple-ios
24+
;;
25+
i386-apple-ios)
26+
rustup target install i386-apple-ios
27+
;;
28+
x86_64-apple-ios)
29+
rustup target install x86_64-apple-ios
30+
;;
31+
esac
32+
33+
# This fetches latest stable release
34+
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
35+
| cut -d/ -f3 \
36+
| grep -E '^v[0.1.0-9.]+$' \
37+
| $sort --version-sort \
38+
| tail -n1)
39+
curl -LSfs https://japaric.github.io/trust/install.sh | \
40+
sh -s -- \
41+
--force \
42+
--git japaric/cross \
43+
--tag $tag \
44+
--target $target
45+
}
46+
47+
main

ci/package.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)