-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 1.91 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (63 loc) · 1.91 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Release Packaging
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build & Package Binary
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
suffix: ""
bin_name: korg-linux-x86_64
- os: macos-latest
target: x86_64-apple-darwin
suffix: ""
bin_name: korg-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
suffix: ""
bin_name: korg-macos-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: ".exe"
bin_name: korg-windows-x86_64.exe
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install musl-tools (Linux Only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build Binary (Release Mode)
run: |
cargo build --release --target ${{ matrix.target }}
- name: Package Binary
shell: bash
run: |
# Copy compiled binary to final package name
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{ matrix.target }}/release/korg.exe ${{ matrix.bin_name }}
else
cp target/${{ matrix.target }}/release/korg ${{ matrix.bin_name }}
chmod +x ${{ matrix.bin_name }}
fi
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.bin_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}