-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 1.59 KB
/
build-binary.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
60
61
62
name: Build Binary Executable
on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
jobs:
build-all:
strategy:
matrix:
target:
- "aarch64-apple-darwin"
- "x86_64-apple-darwin"
- "x86_64-unknown-linux-gnu"
- "aarch64-unknown-linux-gnu"
# - "x86_64-pc-windows-msvc"
name: Build For ${{ matrix.target }}
uses: ./.github/workflows/zigbuild.yml
with:
target: ${{ matrix.target }}
release:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: product
pattern: name-*
merge-multiple: false
- name: compress
run: |
cd product
for dir in */; do
dirname="${dir%/}"
if [[ $dirname == *"windows"* ]]; then
echo "package $dirname to $dirname.zip"
zip -r "$dirname.zip" "$dirname"
else
echo "package $dirname to $dirname.tar.gz"
tar -czf "$dirname.tar.gz" "$dirname"
fi
done
- name: List Directory
run: ls -R product
- name: Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
fail_on_unmatched_files: true
prerelease: false
files: |
./product/*.zip
./product/*.tar.gz