-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.8 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: release
on:
push:
tags:
- 'v[0-9].*'
permissions:
contents: write
jobs:
release:
name: release ${{ matrix.target }}
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
os: ubuntu-latest
artifact: bioimg_gui
- target: x86_64-apple-darwin
os: macos-latest
artifact: bioimg_gui
- target: aarch64-apple-darwin
artifact: bioimg_gui
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
if: matrix.os != 'windows-latest'
run: zip -j modelbuilder_${{ matrix.target }}_${{ github.ref_name }}.zip target/${{ matrix.target }}/release/${{ matrix.artifact }}
- name: zip win
if: matrix.os == 'windows-latest'
run: Compress-Archive -Path target/${{ matrix.target }}/release/${{ matrix.artifact }} -Destination modelbuilder_${{ matrix.target }}_${{ github.ref_name }}.zip
- name: Add binary to release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
draft: true
prerelease: true
generate_release_notes: false
files: |
modelbuilder_${{ matrix.target }}_${{ github.ref_name }}.zip