-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.13 KB
/
release.yml
File metadata and controls
77 lines (64 loc) · 2.13 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
73
74
75
76
77
name: Release Binaries
on:
release:
types: [created]
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64
- os: ubuntu-latest
target: x86_64-linux
artifact_name: stig-x86_64-linux
archive_ext: tar.gz
# Linux aarch64
- os: ubuntu-latest
target: aarch64-linux
artifact_name: stig-aarch64-linux
archive_ext: tar.gz
# macOS x86_64
- os: macos-latest
target: x86_64-macos
artifact_name: stig-x86_64-macos
archive_ext: tar.gz
# macOS aarch64 (Apple Silicon)
- os: macos-latest
target: aarch64-macos
artifact_name: stig-aarch64-macos
archive_ext: tar.gz
# Windows x86_64
- os: windows-latest
target: x86_64-windows
artifact_name: stig-x86_64-windows.exe
archive_ext: zip
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
- name: Build binary
run: zig build -Doptimize=ReleaseFast -Dtarget=${{ matrix.target }}
- name: Prepare artifact (Unix)
if: runner.os != 'Windows'
run: |
cp zig-out/bin/stig ${{ matrix.artifact_name }}
chmod +x ${{ matrix.artifact_name }}
tar -czf ${{ matrix.artifact_name }}.tar.gz ${{ matrix.artifact_name }}
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Copy-Item zig-out\bin\stig.exe ${{ matrix.artifact_name }}
Compress-Archive -Path ${{ matrix.artifact_name }} -DestinationPath ${{ matrix.artifact_name }}.zip
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.artifact_name }}.${{ matrix.archive_ext }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}