update all the things #173
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
name: Continuous Integration | |
on: | |
push: | |
branches: [ master ] | |
tags: ['v*'] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
components: clippy, rustfmt | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.5.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- name: Clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: -- -Dclippy::all | |
- name: Build | |
run: RUSTFLAGS='-C link-arg=-s' cargo build --all --release | |
- name: Name Release | |
if: startsWith(github.ref, 'refs/tags/') | |
id: name_release | |
run: echo ::set-output name=RELEASE::$(echo $GITHUB_REF | cut -d / -f 3)-x86-64-linux | |
- name: Prepare Release | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
RELEASE: virtual-lorawan-device-${{ steps.name_release.outputs.RELEASE }} | |
run: | | |
mkdir $RELEASE | |
mv target/release/virtual-lorawan-device $RELEASE/ | |
cp LICENSE $RELEASE/ | |
tar -zcvf $RELEASE.tar.gz $RELEASE/ | |
- name: Push Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
virtual-lorawan-device-${{ steps.name_release.outputs.RELEASE }}.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: x86_64-apple-darwin | |
default: true | |
override: true | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.5.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Build | |
run: RUSTFLAGS='-C link-arg=-s' cargo build --all --release | |
- name: Name Release | |
if: startsWith(github.ref, 'refs/tags/') | |
id: name_release | |
run: echo ::set-output name=RELEASE::$(echo $GITHUB_REF | cut -d / -f 3)-x86-64-macos | |
- name: Prepare Release | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
RELEASE: virtual-lorawan-device-${{ steps.name_release.outputs.RELEASE }} | |
run: | | |
mkdir $RELEASE | |
mv target/release/virtual-lorawan-device $RELEASE/ | |
cp LICENSE $RELEASE/ | |
tar -zcvf $RELEASE.tar.gz $RELEASE/ | |
- name: Push Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
virtual-lorawan-device-${{ steps.name_release.outputs.RELEASE }}.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |