-
-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (54 loc) · 1.43 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
name: Release
on:
workflow_dispatch:
pull_request:
paths:
- "**.zig"
- ".github/workflows/CI.yml"
- ".github/workflows/release.yml"
push:
branches:
- main
paths:
- "**.zig"
- ".github/workflows/release.yml"
tags:
- "v*"
permissions:
contents: write
jobs:
upload-assets:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- name: Set env
run: |
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "OUT_DIR=/tmp/zigcli-${{ github.ref_name }}" >> $GITHUB_ENV
- name: Build(Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
bash .github/build-release.sh
- name: Build(MacOS)
if: matrix.os == 'macos-latest'
run: |
zig build -Doptimize=ReleaseSafe \
-Dgit_commit=${GIT_COMMIT} -Dbuild_date=${BUILD_DATE}
rm -f zig-out/bin/*demo
cp LICENSE README.org zig-out
pushd zig-out
zip -r ${OUT_DIR}/zigcli-${RELEASE_VERSION}-aarch64-macos.zip .
popd
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.OUT_DIR }}/*