-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tags a la v[0-9].* will trigger this workflow
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9].*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create_release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ github.ref_name }} | ||
draft: true | ||
prerelease: false | ||
generate_release_notes: false | ||
|
||
release: | ||
name: release ${{ matrix.target }} | ||
needs: create_release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-pc-windows-gnu | ||
os: windows-latest | ||
artifact: bioimg_gui.exe | ||
- target: x86_64-unknown-linux-gnu | ||
archive: tar.gz tar.xz tar.zst | ||
os: ubuntu-latest | ||
artifact: bioimg_gui | ||
- target: x86_64-apple-darwin | ||
os: macos-latest | ||
artifact: bioimg_gui | ||
- target: aarch64-apple-darwin | ||
os: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: install linux deps | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get update && sudo apt-get install libgtk-3-dev | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
- name: Build | ||
run: cargo build --target ${{ matrix.target }} --release --package bioimg_gui | ||
- name: zip | ||
run: zip bioimg_gui-${{ matrix.target }}_${{ github.ref_name }}.zip target/${{ matrix.target }}/release/${{ matrix.artifact }} | ||
- name: Add binary to release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
bioimg_gui-${{ matrix.target }}_${{ github.ref_name }}.zip | ||