-
Notifications
You must be signed in to change notification settings - Fork 7
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
10 changed files
with
266 additions
and
11 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
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,63 @@ | ||
# Based on the "trust" template v0.1.2 | ||
# https://github.com/japaric/trust/tree/v0.1.2 | ||
|
||
dist: trusty | ||
language: rust | ||
services: docker | ||
sudo: required | ||
|
||
env: | ||
global: | ||
- CRATE_NAME=dot-http | ||
|
||
matrix: | ||
include: | ||
# Linux | ||
- env: TARGET=aarch64-unknown-linux-gnu | ||
- env: TARGET=i686-unknown-linux-gnu | ||
- env: TARGET=x86_64-unknown-linux-gnu | ||
|
||
- env: TARGET=x86_64-apple-darwin | ||
os: osx | ||
|
||
before_install: | ||
- set -e | ||
- rustup self update | ||
|
||
install: | ||
- sh ci/install.sh | ||
- source ~/.cargo/env || true | ||
|
||
script: | ||
- bash ci/script.sh | ||
|
||
after_script: set +e | ||
|
||
before_deploy: | ||
- sh ci/before_deploy.sh | ||
|
||
deploy: | ||
api_key: | ||
secure: iMEVLVkdaa3yFt3cDhCBe7s9GnNx9SlKIYQAzyrfp/Fo02Fc7STmfnKeolHTtu9BAWYNpvbZoNZuluMuhjLfKCYocD9rsKMOZAwcd9btrTs1xtK+4NXQQnfsL7CuBA2U7Wac176yV7jW6ysV5xT0PBqXs+oQOPKPbxLamRLdt72XYlm/tjEn2zLskF/+vjIJfTHp/6O80fiL2iGxqWW2Dqz9/84EJB3DgDQ6HHtNu9tCwiSD7GL+S0JXZKnTmxMIvC7RXYiWVl9bxGFtMP5fLd30LscpOZb350Myhw7ngxlGw7jpVEgY3ySyv0ItmoFnba80GfeyKHJLEmdj47mW5crKaUKrG/yqXOKUO+IHjNNCiDI7mFBDsSshtXa8RbZ7LT5pgCjhcJl2d1DHq8o+oWZfB/NoHILYWPGMOHkZDFybN95cEEWnATC7CmIE41plf99Jm62PKwVNUcc8qJsPaOW42sXmN12E0gqscMG9IDPY2WrcgAD4JavegIoqUZhLlxPiytFPsHb2mBi5dz5vKYJIajfm3EI/f/VV9kjYEMWJOpTJI1yTYT60cQEfo7MeNgvkjQjR8ahVQhoc/pxkV5PAm+BnFr9PObZooqDX9KHvaReBCx1eYX7kxRSIN8yUuQJEpjLxT/ZAMqOczNVxbtz1j/WGPCKT5lRh2ZGlxWE= | ||
file_glob: true | ||
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* | ||
on: | ||
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 |
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
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,69 @@ | ||
# Based on the "trust" template v0.1.2 | ||
# https://github.com/japaric/trust/tree/v0.1.2 | ||
|
||
environment: | ||
global: | ||
RUST_VERSION: stable | ||
CRATE_NAME: dot-http | ||
|
||
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 | ||
|
||
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 %CRATE_NAME% -- -C lto | ||
- ps: ci\before_deploy.ps1 | ||
|
||
deploy: | ||
artifact: /.*\.zip/ | ||
auth_token: | ||
secure: 62I0EPYa6QqOFCK4+5E/tfHhFWjOu5zPp34mdBprZsc4cGkktalSVdnQ27GtxxST | ||
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 | ||
|
||
# Building is done in the test phase, so we disable Appveyor's build phase. | ||
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\$(env:CRATE_NAME).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,31 @@ | ||
# This script takes care of building your crate and packaging it for release | ||
|
||
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 dot-http --target $TARGET --release -- -C lto | ||
|
||
cp target/$TARGET/release/dot-http $stage/ | ||
|
||
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,47 @@ | ||
set -ex | ||
|
||
main() { | ||
local target= | ||
if [ $TRAVIS_OS_NAME = linux ]; then | ||
target=x86_64-unknown-linux-musl | ||
sort=sort | ||
else | ||
target=x86_64-apple-darwin | ||
sort=gsort # for `sort --sort-version`, from brew's coreutils. | ||
fi | ||
|
||
# Builds for iOS are done on OSX, but require the specific target to be | ||
# installed. | ||
case $TARGET in | ||
aarch64-apple-ios) | ||
rustup target install aarch64-apple-ios | ||
;; | ||
armv7-apple-ios) | ||
rustup target install armv7-apple-ios | ||
;; | ||
armv7s-apple-ios) | ||
rustup target install armv7s-apple-ios | ||
;; | ||
i386-apple-ios) | ||
rustup target install i386-apple-ios | ||
;; | ||
x86_64-apple-ios) | ||
rustup target install x86_64-apple-ios | ||
;; | ||
esac | ||
|
||
# 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.1.0-9.]+$' \ | ||
| $sort --version-sort \ | ||
| tail -n1) | ||
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,20 @@ | ||
# This script takes care of testing your crate | ||
|
||
set -ex | ||
|
||
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 | ||
} | ||
|
||
# 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