Skip to content

Commit

Permalink
feat: Automatically publish artifacts to GitHub
Browse files Browse the repository at this point in the history
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
Sean authored and 0xazure committed Dec 3, 2018
1 parent 1cf894c commit 66f5bc5
Showing 1 changed file with 82 additions and 15 deletions.
97 changes: 82 additions & 15 deletions .travis.yml
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

0 comments on commit 66f5bc5

Please sign in to comment.