-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Automatically publish artifacts to GitHub
Travis will now publish a tarball containing the README, LICENSE-MIT, LICENSE-APACHE and the executable for Supernova. This process is done only for the Linux and Windows stable builds upon pushing a new tag. In addition, we'll also provide a SHA1 hash for peace of mind. Fixes #17
- Loading branch information
Showing
1 changed file
with
82 additions
and
15 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,27 +1,94 @@ | ||
language: rust | ||
branches: | ||
only: | ||
- master | ||
os: | ||
- linux | ||
- windows | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
sudo: false | ||
|
||
# Need to cache the whole `.cargo` directory to keep .crates.toml for | ||
# cargo-update to work, but don't cache the cargo registry | ||
before_cache: | ||
- rm -rf /home/travis/.cargo/registry | ||
cache: | ||
directories: | ||
- /home/travis/.cargo | ||
before_script: | ||
- if [[ "$TRAVIS_RUST_VERSION" == "stable" || "$TRAVIS_RUST_VERSION" == "nightly" ]]; then rustup component add clippy-preview; fi | ||
script: | ||
- if [[ "$TRAVIS_RUST_VERSION" == "stable" || "$TRAVIS_RUST_VERSION" == "nightly" ]]; then cargo clippy --all-targets --all-features -- -D warnings; fi | ||
- cargo test --verbose | ||
|
||
DEPLOY_TO_GITHUB: &DEPLOY_TO_GITHUB | ||
before_deploy: | ||
- name="supernova-$TRAVIS_TAG-$TARGET" | ||
- mkdir $name | ||
- cp target/$TARGET/release/supernova $name/ | ||
- cp README.md LICENSE-MIT LICENSE-APACHE $name/ | ||
- tar czvf $name.tar.gz $name | ||
- sha1sum $name.tar.gz > $name.tar.gz.sha1 | ||
deploy: | ||
provider: releases | ||
api_key: $GH_TOKEN | ||
file: | ||
- supernova-$TRAVIS_TAG-$TARGET.tar.gz | ||
- $name.tar.gz.sha1 | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
repo: 0xazure/supernova | ||
tags: true | ||
|
||
matrix: | ||
allow_failures: | ||
- rust: nightly | ||
fast_finish: true | ||
include: | ||
- name: Linux-Stable | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: stable | ||
before_script: | ||
- rustup component add clippy-preview | ||
script: | ||
- cargo clippy --all-targets --all-features -- -D warnings | ||
- cargo test --verbose | ||
- cargo build --release --target $TARGET --locked | ||
<<: *DEPLOY_TO_GITHUB | ||
|
||
- name: Linux-Beta | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: beta | ||
script: | ||
- cargo test --verbose | ||
- cargo build --verbose | ||
|
||
- name: Linux-Nightly | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
rust: nightly | ||
before_script: | ||
- rustup component add clippy-preview | ||
script: | ||
- cargo clippy --all-targets --all-features -- -D warnings | ||
- cargo test --verbose | ||
- cargo build --verbose | ||
|
||
- name: Windows-Stable | ||
os: windows | ||
env: TARGET=x86_64-pc-windows-msvc | ||
rust: stable | ||
before_script: | ||
- rustup component add clippy-preview | ||
script: | ||
- cargo clippy --all-targets --all-features -- -D warnings | ||
- cargo test --verbose | ||
- cargo build --release --target $TARGET --locked | ||
<<: *DEPLOY_TO_GITHUB | ||
|
||
- name: Windows-Beta | ||
os: windows | ||
env: TARGET=x86_64-pc-windows-msvc | ||
rust: beta | ||
script: | ||
- cargo test --verbose | ||
- cargo build --verbose | ||
|
||
- name: Windows-Nightly | ||
os: windows | ||
env: TARGET=x86_64-pc-windows-msvc | ||
rust: nightly | ||
before_script: | ||
- rustup component add clippy-preview | ||
script: | ||
- cargo clippy --all-targets --all-features -- -D warnings | ||
- cargo test --verbose | ||
- cargo build --verbose |