Skip to content

Commit cdd58ae

Browse files
committed
Attempt at fixing Travis
1 parent abcf9f2 commit cdd58ae

File tree

4 files changed

+72
-26
lines changed

4 files changed

+72
-26
lines changed

.travis.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,26 @@ language: rust
66
services: docker
77
sudo: required
88

9-
# TODO Rust builds on stable by default, this can be
10-
# overridden on a case by case basis down below.
11-
129
env:
1310
global:
14-
# TODO Update this to match the name of your project.
15-
- CRATE_NAME=trust
11+
- CRATE_NAME=cache-size
1612

1713
matrix:
18-
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
19-
# don't need
2014
include:
2115
# Linux
22-
# - env: TARGET=aarch64-unknown-linux-gnu
23-
# - env: TARGET=arm-unknown-linux-gnueabi
24-
# - env: TARGET=armv7-unknown-linux-gnueabihf
25-
- env: TARGET=i686-unknown-linux-gnu
26-
- env: TARGET=i686-unknown-linux-musl
27-
# - env: TARGET=mips-unknown-linux-gnu
28-
# - env: TARGET=mips64-unknown-linux-gnuabi64
29-
# - env: TARGET=mips64el-unknown-linux-gnuabi64
30-
# - env: TARGET=mipsel-unknown-linux-gnu
31-
# - env: TARGET=powerpc-unknown-linux-gnu
32-
# - env: TARGET=powerpc64-unknown-linux-gnu
33-
# - env: TARGET=powerpc64le-unknown-linux-gnu
34-
# - env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
3516
- env: TARGET=x86_64-unknown-linux-gnu
3617
- env: TARGET=x86_64-unknown-linux-musl
3718

3819
# OSX
39-
- env: TARGET=i686-apple-darwin
40-
os: osx
4120
- env: TARGET=x86_64-apple-darwin
4221
os: osx
4322

4423
# *BSD
45-
- env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
4624
- env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
4725
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
4826

4927
# Windows
50-
- env: TARGET=x86_64-pc-windows-gnu DISABLE_TESTS=1
28+
- env: TARGET=x86_64-pc-windows-gnu
5129

5230
# Testing other channels
5331
- env: TARGET=x86_64-unknown-linux-gnu
@@ -69,10 +47,19 @@ script:
6947

7048
after_script: set +e
7149

72-
# .travis.yml
50+
before_deploy:
51+
- sh ci/before_deploy.sh
52+
7353
deploy:
54+
api_key:
55+
secure: "ZqTDKMOQ22XmXxRb3ff/r8HekyK/uXv66RsV1XCMgwBwfzKkNofgVI1j41IMsU/TdGR85vk/S+f4B9Sf+xUDT3qURhCBjpda025yWNkURP+fDnSEU1mqetRAwR6Jf09c+7J2MMLGPxdz32cmU3xoPAOz0yam0n22lwbOoPw3R16og1At/cXPeG5Be3/cQf4N844jhgPQbbQnx+YsUKRgf8pLc9xCCl4Pc4nSXgP4oFj3DZVPY0yKX+VhRGO8r1YOiuGaH+9OxeKcdp6vR39FbhROPY/12aFXweqLNjO7uIazqp7zThy0/NzLIXAT/3IURJBCPzHKSsuivK5s72ZmmilX6voSXLdzmGdalUs6Fq0JTWTAVeeWyNMasNKhY2y2/OAGI69KegXk9yjbJWNf+26CaWPep75EBgYw5Ez42XL0Ep+NpHDc3Ybf/Ure0mVx7H9atvVtdg1JfGCEKZAKkNV4qLLFKQSo0CkGYCI1nuziIpLlGDHk3d1vkw6TBPc50ecxoLtLAumxkEzRBzIxeIARPQDQw3TC4EhqRy4NFaMHYxPvRMRFygfgKYfP3kUNvxqEWlLTs8VIJFG3EmV+4hhJ6em0uGER8XQ07H2oCa0d2roXO03QcA27frj2JbQP7/TxLR4fGmBJECHr+c0vft0T4Vggf0ukcLSG35yzhr0="
56+
file_glob: true
57+
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.*
7458
on:
75-
condition: $DEPLOY = never
59+
condition: $TRAVIS_RUST_VERSION = stable
60+
tags: true
61+
provider: releases
62+
skip_cleanup: true
7663

7764
cache: cargo
7865
before_cache:

ci/before_deploy.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This script takes care of packaging the build artifacts that will go in the
2+
# release zipfile
3+
4+
$SRC_DIR = $PWD.Path
5+
$STAGE = [System.Guid]::NewGuid().ToString()
6+
7+
Set-Location $ENV:Temp
8+
New-Item -Type Directory -Name $STAGE
9+
Set-Location $STAGE
10+
11+
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
12+
13+
# TODO Update this to package the right artifacts
14+
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\hello.exe" '.\'
15+
16+
7z a "$ZIP" *
17+
18+
Push-AppveyorArtifact "$ZIP"
19+
20+
Remove-Item *.* -Force
21+
Set-Location ..
22+
Remove-Item $STAGE
23+
Set-Location $SRC_DIR

ci/before_deploy.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
# TODO Update this to build the artifacts that matter to you
21+
cross rustc --bin hello --target $TARGET --release -- -C lto
22+
23+
# TODO Update this to package the right artifacts
24+
cp target/$TARGET/release/hello $stage/
25+
26+
cd $stage
27+
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
28+
cd $src
29+
30+
rm -rf $stage
31+
}
32+
33+
main

ci/script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ main() {
1313

1414
cross test --target $TARGET
1515
cross test --target $TARGET --release
16+
17+
cross run --target $TARGET
18+
cross run --target $TARGET --release
1619
}
1720

1821
# we don't run the "test phase" when doing deploys

0 commit comments

Comments
 (0)