-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (56 loc) · 2.14 KB
/
release_v2.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
59
name: Release v2
on:
release:
types: [created]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build
runs-on: ${{ matrix.case.os }}
strategy:
matrix:
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
case:
- target: x86_64-pc-windows-msvc
output: target/x86_64-pc-windows-msvc/release/fpgrars.exe
finalOutput: target/x86_64-pc-windows-msvc/release/fpgrars-x86_64-pc-windows-msvc
finalOutputExt: .exe
os: windows-latest
- target: x86_64-unknown-linux-gnu
output: target/x86_64-unknown-linux-gnu/release/fpgrars
finalOutput: target/x86_64-unknown-linux-gnu/release/fpgrars-x86_64-unknown-linux-gnu
finalOutputExt: ""
os: ubuntu-20.04
- target: x86_64-apple-darwin
output: target/x86_64-apple-darwin/release/fpgrars
finalOutput: target/x86_64-apple-darwin/release/fpgrars-x86_64-apple-darwin
finalOutputExt: ""
os: macos-latest
features:
- list: ""
output-add: --original
- list: unb
output-add: --unb
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install ALSA (for MIDI support)
if: matrix.case.os == 'ubuntu-20.04'
run: sudo apt-get install libasound2-dev
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.case.target }}
args: "--profile release --features=${{ matrix.features.list }}"
strip: true
- name: Rename output
run: mv ${{ matrix.case.output }} ${{ matrix.case.finalOutput }}${{ matrix.features.output-add }}${{ matrix.case.finalOutputExt }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.case.finalOutput }}${{ matrix.features.output-add }}${{ matrix.case.finalOutputExt }} # amazing
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}