-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
272 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,89 @@ | ||
sudo: false | ||
# Based on the "trust" template v0.1.1 | ||
# https://github.com/japaric/trust/tree/v0.1.1 | ||
|
||
language: generic | ||
dist: trusty | ||
language: rust | ||
services: docker | ||
sudo: required | ||
|
||
env: | ||
global: | ||
- 'PATH=$HOME/.cargo/bin/:$PATH' | ||
- CRATE_NAME=envsub | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
env: TARGET=x86_64-unknown-linux-musl | ||
#- os: osx | ||
# env: TARGET=x86_64-apple-darwin | ||
# Linux | ||
- env: TARGET=i686-unknown-linux-gnu | ||
- env: TARGET=i686-unknown-linux-musl | ||
- env: TARGET=x86_64-unknown-linux-gnu | ||
- env: TARGET=x86_64-unknown-linux-musl | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- upx-ucl | ||
# OSX | ||
- env: TARGET=i686-apple-darwin | ||
os: osx | ||
- env: TARGET=x86_64-apple-darwin | ||
os: osx | ||
|
||
# *BSD | ||
- env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1 | ||
- env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 | ||
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 | ||
|
||
# Other architectures | ||
- env: TARGET=aarch64-unknown-linux-gnu | ||
- env: TARGET=armv7-unknown-linux-gnueabihf | ||
- env: TARGET=mips-unknown-linux-gnu | ||
- env: TARGET=mips64-unknown-linux-gnuabi64 | ||
- env: TARGET=mips64el-unknown-linux-gnuabi64 | ||
- env: TARGET=mipsel-unknown-linux-gnu | ||
- env: TARGET=powerpc-unknown-linux-gnu | ||
- env: TARGET=powerpc64-unknown-linux-gnu | ||
- env: TARGET=powerpc64le-unknown-linux-gnu | ||
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1 | ||
|
||
# Testing other channels | ||
- env: TARGET=x86_64-unknown-linux-gnu | ||
rust: nightly | ||
- env: TARGET=x86_64-apple-darwin | ||
os: osx | ||
rust: nightly | ||
|
||
before_install: set -e | ||
|
||
install: | ||
- bash ./ci/install.sh | ||
- source ~/.cargo/env || true | ||
|
||
script: | ||
- make bootstrap all | ||
- cp target/$TARGET/release/envsub envsub-$TRAVIS_TAG-$TARGET | ||
- bash ./ci/script.sh | ||
|
||
after_script: set +e | ||
|
||
before_deploy: | ||
# This is a hack to fix deploy failures from dpl. | ||
# Apparently they thought it wasn't worth pinning octokit. | ||
- rvm 1.9.3 do gem install octokit -v 4.3.0 | ||
- bash ./ci/before_deploy.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: imeZd34kwpLJ9lFuUhmydIVqnbf3Ws75doNHMOwBivm+UKuPzEmmgMuWB7j/FUSDI9AaFD1RZjWjvG+bMjlelp6CEArx9vdZPORhjnaSQGbUMsZ1PzFjTOkPeMOa+mweeAeTJkJYZkl8CvnOHwF3wqxiNuTD6m5rzomE6XRsZtBi1LKOz6Ynk/PQ1VoSoXwfa14i12hOYHzZWfET1/7fpm+EcUNjimDF1K44Uhgln7WqiEK32D0rOphkgHYJTaNMEMcm1lT7ModBrw+W83+ydfJfgSTHMz6VT8EXM4ou+9E80oXYAsOS13EOAihp2vxjrsh/h/Acdzzd+QMbJVp7qkI7mDh3M0IMpOMezxqWEFBwXn0SYGwHaRNbHFU0efKjCcqBVKyDRJ09Hu4KBvo/h4Vift0CSQHW4qj0zc5jYu9/nuxWOR8XcbogblJYkBKE+zzzETe8Nv4GdunzPDI30vyerNybcGp4FmMbLYINVYBl4Aslbi8B2MzVuXtqKl6+fGapRZoZWy0kw0aUJWAeU9mP8838L4lwICusd6RiXq2opb8xwpY2fDJkERogxNfyPVjJRDdh9y33RQ8JpCvFKd29cSt7oLb1wmJrNWSBlRXdVCLIRS+1iD4cdEr4LZ/77CPFcOCo2AjFF4p6xf55eFyKCvm3yBWjQmrVJASQXjA= | ||
file: envsub-$TRAVIS_TAG-$TARGET | ||
skip_cleanup: true | ||
secure: FzOd114HkQwSOsTftckdJUUnym1VSIk6QdNYuxR/F89rfZYZYw3lCGNGOGgJ5TmzwJ3hjga5k32jC1Ms96wJdyiR6iEskrspuWZdBxQKi0zL9BbQcDcutBvh0Kj/sQgU4nuot0nrpKUJjnw+a1BEkf4itWM2eEOTupxjMZ5K05MhZoF6sN/vNey1tFdV53lu7cPBmdfj9QzkqYPVqFOjYkeO+/6OXsehHN1VFduYJQS8zk+3VdAhNaTMxOsEgw10p5MWN2O7cGWDC4cQOYBUh/A8lOMmNjegxp8QYD/LamM8v8eouKOaHjf56S5Wp76GxDHWm9AWmBp+TvrNOizQWtWVcilKJ/npDInSsyTUjTDB+P09mpHVr0DW6hTQq8HpSHMuKkWg5V3dMoElDpUDUaA+MVl1YnFNdpS7arxR6m3Pv0De1Il0YOd35EDWvzxz2V8MfdmLfXwT58FCYRqFKdwAdU3TQQ3aYaCs23lx0wPv+DWviUl/QXBxNwkxbiusbn15CR5JFRk8/9+RufHeflAxxiy/X0OKsCel8Cf03yW72FqnUBTIhAqdVYw9Jlh4cG2m4ecJ08brsQ3IQ1/BKOh9A9RbeUCBelssFvrJQ40hWMU6ZMPc7ZFo+0gZSbvfgm/qRoDSb7COg5HcyoXHTCa2rNxJTO52b6U0li93OGM= | ||
file_glob: true | ||
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* | ||
on: | ||
repo: gdvalle/envsub | ||
condition: $TRAVIS_RUST_VERSION = stable | ||
tags: true | ||
provider: releases | ||
skip_cleanup: true | ||
|
||
cache: cargo | ||
before_cache: | ||
# Travis can't cache files that are not readable by "others" | ||
- chmod -R a+r $HOME/.cargo | ||
|
||
branches: | ||
only: | ||
# release tags | ||
- /^v\d+\.\d+\.\d+.*$/ | ||
- master | ||
|
||
notifications: | ||
email: | ||
on_success: never |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Based on the "trust" template v0.1.1 | ||
# https://github.com/japaric/trust/tree/v0.1.1 | ||
|
||
environment: | ||
global: | ||
RUST_VERSION: stable | ||
|
||
CRATE_NAME: envsub | ||
|
||
matrix: | ||
# MinGW | ||
- TARGET: i686-pc-windows-gnu | ||
- TARGET: x86_64-pc-windows-gnu | ||
|
||
# MSVC | ||
- TARGET: i686-pc-windows-msvc | ||
- TARGET: x86_64-pc-windows-msvc | ||
|
||
# Testing other channels | ||
- TARGET: x86_64-pc-windows-gnu | ||
RUST_VERSION: nightly | ||
- TARGET: x86_64-pc-windows-msvc | ||
RUST_VERSION: nightly | ||
|
||
install: | ||
- ps: >- | ||
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') { | ||
$Env:PATH += ';C:\msys64\mingw64\bin' | ||
} ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') { | ||
$Env:PATH += ';C:\msys64\mingw32\bin' | ||
} | ||
- curl -sSf -o rustup-init.exe https://win.rustup.rs/ | ||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION% | ||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin | ||
- rustc -Vv | ||
- cargo -V | ||
|
||
test_script: | ||
# we don't run the "test phase" when doing deploys | ||
- if [%APPVEYOR_REPO_TAG%]==[false] ( | ||
cargo build --target %TARGET% && | ||
cargo build --target %TARGET% --release && | ||
cargo test --target %TARGET% && | ||
cargo test --target %TARGET% --release | ||
) | ||
|
||
before_deploy: | ||
- cargo rustc --target %TARGET% --release --bin envsub -- -C lto -C panic=abort | ||
- ps: ci\before_deploy.ps1 | ||
|
||
deploy: | ||
artifact: /.*\.zip/ | ||
auth_token: | ||
secure: 0C4QL3dVOD9QMqHScEhT7lIOvrtMiynv5cncHw7CrGl6WCAjIlYUZX1m29LmTUOm | ||
description: '' | ||
on: | ||
RUST_VERSION: stable | ||
appveyor_repo_tag: true | ||
provider: GitHub | ||
|
||
cache: | ||
- C:\Users\appveyor\.cargo\registry | ||
- target | ||
|
||
branches: | ||
only: | ||
# Release tags | ||
- /^v\d+\.\d+\.\d+.*$/ | ||
- master | ||
|
||
notifications: | ||
- provider: Email | ||
on_build_success: false | ||
|
||
# disable automatic builds | ||
build: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This script takes care of packaging the build artifacts that will go in the | ||
# release zipfile | ||
|
||
$SRC_DIR = $PWD.Path | ||
$STAGE = [System.Guid]::NewGuid().ToString() | ||
|
||
Set-Location $ENV:Temp | ||
New-Item -Type Directory -Name $STAGE | ||
Set-Location $STAGE | ||
|
||
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip" | ||
|
||
# TODO Update this to package the right artifacts | ||
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\envsub.exe" '.\' | ||
|
||
7z a "$ZIP" * | ||
|
||
Push-AppveyorArtifact "$ZIP" | ||
|
||
Remove-Item *.* -Force | ||
Set-Location .. | ||
Remove-Item $STAGE | ||
Set-Location $SRC_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This script takes care of building your crate and packaging it for release | ||
|
||
BIN="envsub" | ||
|
||
set -ex | ||
|
||
main() { | ||
local src=$(pwd) \ | ||
stage= | ||
|
||
case $TRAVIS_OS_NAME in | ||
linux) | ||
stage=$(mktemp -d) | ||
;; | ||
osx) | ||
stage=$(mktemp -d -t tmp) | ||
;; | ||
esac | ||
|
||
test -f Cargo.lock || cargo generate-lockfile | ||
|
||
cross rustc --bin "$BIN" --target $TARGET --release -- -C lto -C "panic=abort" | ||
|
||
cp "target/$TARGET/release/$BIN" $stage/ | ||
|
||
# Strip and compress the executable. | ||
# Binary strip will fail on non x86 platforms because we're using the | ||
# host's strip binary. | ||
strip -s "$stage/$BIN" || echo "Failed stripping binary; proceeding anyway" | ||
# Some platforms, like mips, return an UnknownExecutableFormatException. | ||
upx --brute "$stage/$BIN" || echo "Failed compressing binary; proceeding anyway" | ||
|
||
cd $stage | ||
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz * | ||
cd $src | ||
|
||
rm -rf $stage | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
set -ex | ||
|
||
main() { | ||
curl https://sh.rustup.rs -sSf | \ | ||
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION | ||
|
||
local target= | ||
if [ $TRAVIS_OS_NAME = linux ]; then | ||
target=x86_64-unknown-linux-gnu | ||
sort=sort | ||
sudo apt-get install -y --no-install-recommends upx-ucl | ||
else | ||
target=x86_64-apple-darwin | ||
sort=gsort # for `sort --sort-version`, from brew's coreutils. | ||
brew install upx | ||
fi | ||
|
||
# This fetches latest stable release | ||
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ | ||
| cut -d/ -f3 \ | ||
| grep -E '^v[0-9.]+$' \ | ||
| $sort --version-sort \ | ||
| tail -n1) | ||
echo cross version: $tag | ||
curl -LSfs https://japaric.github.io/trust/install.sh | \ | ||
sh -s -- \ | ||
--force \ | ||
--git japaric/cross \ | ||
--tag $tag \ | ||
--target $target | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This script takes care of testing your crate | ||
|
||
set -ex | ||
|
||
# TODO This is the "test phase", tweak it as you see fit | ||
main() { | ||
cross build --target $TARGET | ||
cross build --target $TARGET --release | ||
|
||
if [ ! -z $DISABLE_TESTS ]; then | ||
return | ||
fi | ||
|
||
cross test --target $TARGET | ||
cross test --target $TARGET --release | ||
|
||
#cross run --target $TARGET | ||
#cross run --target $TARGET --release | ||
} | ||
|
||
# we don't run the "test phase" when doing deploys | ||
if [ -z $TRAVIS_TAG ]; then | ||
main | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters