Skip to content

Commit

Permalink
publish binaries to github using travis
Browse files Browse the repository at this point in the history
  • Loading branch information
smacker committed Aug 4, 2019
1 parent 9067708 commit 6c7cdc5
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
language: rust
rust: stable

matrix:
stages:
- name: tests
- name: release
if: tag IS present

jobs:
include:
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-gnu
- os: osx
rust: stable
env: TARGET=x86_64-apple-darwin
# Code checks
- os: linux
rust: stable
- stage: tests
name: 'Code checks'
install:
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fmt -- --check
- cargo clippy -- -D warnings

script:
- cargo build --target "$TARGET" --verbose
- stage: release
name: 'Release linux'
os: linux
env: TARGET=x86_64-unknown-linux-gnu
script:
- cargo build --target "$TARGET" --release
- mkdir -p ./dist/standup-${TRAVIS_TAG}-$TARGET
- mv ./target/$TARGET/release/standup_rs ./dist/standup-${TRAVIS_TAG}-$TARGET/
- tar -cvzf ./dist/standup-${TRAVIS_TAG}-$TARGET.tar.gz ./dist/standup-${TRAVIS_TAG}-$TARGET/
deploy:
provider: releases
api_key:
secure: $GITHUB_TOKEN
file: ./dist/*.tar.gz
file_glob: true
skip_cleanup: true
on:
tags: true

- stage: release
name: 'Release macOs'
os: osx
env: TARGET=x86_64-apple-darwin
script:
- cargo build --target "$TARGET" --release
- mkdir -p ./dist/standup-${TRAVIS_TAG}-$TARGET
- mv ./target/$TARGET/release/standup_rs ./dist/standup-${TRAVIS_TAG}-$TARGET/
- tar -cvzf ./dist/standup-${TRAVIS_TAG}-$TARGET.tar.gz ./dist/standup-${TRAVIS_TAG}-$TARGET/
deploy:
provider: releases
api_key:
secure: $GITHUB_TOKEN
file: ./dist/*.tar.gz
file_glob: true
skip_cleanup: true
on:
tags: true

cache:
directories:
Expand Down

0 comments on commit 6c7cdc5

Please sign in to comment.