on:
release:
types: [created]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
defaults:
run:
shell: bash
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest, windows-2019]
steps:
- uses: actions/checkout@v2
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-18.04'
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Build archive
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [ "${{ matrix.os }}" = "ubuntu-18.04" ]; then
staging=BeeBeep-$VERSION-linux
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
staging=BeeBeep-$VERSION-macos
elif [ "${{ matrix.os }}" = "windows-2019" ]; then
staging=BeeBeep-$VERSION-win
fi
mkdir $staging
if [ "${{ matrix.os }}" = "windows-2019" ]; then
mv target/release/beebeep.exe $staging
7z a $staging.zip $staging
echo "FILE=$staging.zip" >> $GITHUB_ENV
else
mv target/release/beebeep $staging
tar czf $staging.tar.gz $staging
echo "FILE=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
files: ${{ env.FILE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}