I have a travis job that runs on both Linux and OSX, which I would like to be able to use to deploy different build artefacts for each platform to github releases. My .travis.yml
file currently looks something like this:
language: rust
cache: cargo
os:
- linux
- osx
rust:
- stable
- beta
- nightly
script:
- cargo build --release -vv
- cargo test --release --all -vv
matrix:
allow_failures:
- rust: nightly
fast_finish: true
deploy:
- provider: releases
skip_cleanup: true
api_key:
secure: <encrypted key here, removed for brevity>
before_deploy:
- cargo install cargo-deb
- cargo deb --no-build --no-strip
- ./scripts/package_linux.sh .
file_glob: true
file:
- "target/debian/ellington_0.1.0_amd64.deb"
- "releases/*_linux.zip"
on:
tags: true
os: linux
rust: stable
I assume that I add a second deploy step (e.g. see below), but I can't find any documentation on how to do this, let alone whether it's even possible. There is extensive documentation on deploying to multiple providers, but not on deploying multiple times to the same providers on different platforms.
- provider: releases
skip_cleanup: true
api_key:
secure: <encrypted key here, removed for brevity>
before_deploy:
- ./scripts/package_osx.sh .
file_glob: true
file:
- "releases/*_osx.zip"
on:
tags: true
os: osx
rust: stable
A build matrix is made up by several multiple jobs that run in parallel. This can be useful in many cases, but the two primary reasons to use a build matrix are: Reducing the overall build execution time. Running tests against different versions of runtimes or dependencies.
Continuous Deployment to the following providers is supported: anynines. AWS CloudFormation. AWS CodeDeploy.
Check out this link!
The gist of it is yes, you were on the right track and you can define multiple deployments like so:
deploy:
- provider: releases
api_key: "<deploy key>"
file:
- "target/release.deb"
skip_cleanup: true
on:
tags: true
- provider: releases
api_key: "<deploy key>"
file:
- "target/release.dmg"
skip_cleanup: true
on:
tags: true
- provider: releases
etc...
Relevant documentation for this feature can also be found here. approximately halfway through the conditional deployment section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With