Skip to content

Commit

Permalink
add release workflow for tags
Browse files Browse the repository at this point in the history
tags a la v[0-9].* will trigger this workflow
  • Loading branch information
k-dominik committed Jun 3, 2024
1 parent 3e8ad63 commit eefb81d
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit eefb81d

Please sign in to comment.