.github/workflows/release.yml #34
Workflow file for this run
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
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
name: Release target ${{ matrix.target }} | |
runs-on: ${{ matrix.runner-os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, x86_64-apple-darwin ] | |
include: | |
- runner-os: ubuntu-latest | |
- binary-suffix: '' | |
- target: x86_64-pc-windows-gnu | |
binary-suffix: .exe | |
setup-script: sudo apt-get install mingw-w64 | |
- target: x86_64-unknown-linux-gnu | |
setup-script: ./aftiktuna-rust/linux-ubuntu-setup.sh | |
- target: x86_64-apple-darwin | |
runner-os: macos-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.target }} | |
- name: Run setup script | |
if: matrix.setup-script != null | |
run: ${{ matrix.setup-script }} | |
- name: Build binary | |
run: cargo build --manifest-path aftiktuna-rust/Cargo.toml --release --target ${{ matrix.target }} --bin aftiktuna | |
- name: Package files | |
run: | | |
mkdir build-output | |
cp aftiktuna-rust/target/${{ matrix.target }}/release/aftiktuna${{ matrix.binary-suffix }} build-output | |
cp aftiktuna-rust/readme.txt build-output | |
cp -R aftiktuna-rust/assets build-output | |
cd build-output && zip -9r aftiktuna-${{ matrix.target }}.zip * | |
- name: Upload release archive | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build-output/aftiktuna-${{ matrix.target }}.zip | |
asset_name: aftiktuna-${{ github.ref_name }}-${{ matrix.target }}.zip | |
tag: ${{ github.ref }} |