-
Notifications
You must be signed in to change notification settings - Fork 140
83 lines (74 loc) · 2.59 KB
/
Copy pathrelease-binaries.yml
File metadata and controls
83 lines (74 loc) · 2.59 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
78
79
80
81
82
83
name: Release Binaries
on:
release:
types: [published]
workflow_call:
inputs:
tag:
required: true
type: string
workflow_dispatch:
inputs:
tag:
required: true
type: string
# Serialize runs per tag: release/workflow_call/workflow_dispatch can otherwise
# race on uploading assets for the same release.
concurrency:
group: release-binaries-${{ inputs.tag || github.event.release.tag_name }}
cancel-in-progress: false
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
# Native runner per target: cross-compiles bundle the host's @napi-rs/keyring
# native addon, and the binary crashes on every other platform.
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- target: bun-linux-x64
runner: ubuntu-latest
outfile: dist/qawolf-linux-x64
# ubuntu-24.04-arm assumes the repo is public (free arm runners)
- target: bun-linux-arm64
runner: ubuntu-24.04-arm
outfile: dist/qawolf-linux-arm64
# macos-15-intel is the last Intel macOS image (supported until fall 2027)
- target: bun-darwin-x64
runner: macos-15-intel
outfile: dist/qawolf-darwin-x64
- target: bun-darwin-arm64
runner: macos-latest
outfile: dist/qawolf-darwin-arm64
- target: bun-windows-x64
runner: windows-latest
outfile: dist/qawolf-windows-x64.exe
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- name: Build binary
run: bun run build:binary --target="${{ matrix.target }}" --outfile="${{ matrix.outfile }}"
- name: Smoke test binary
run: ./${{ matrix.outfile }} --version
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# env indirection keeps the dispatch-provided tag out of shell template expansion
RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }}
run: |
[[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.]+)?$ ]] || {
echo "Invalid release tag: $RELEASE_TAG" >&2
exit 1
}
gh release upload "$RELEASE_TAG" "${{ matrix.outfile }}" --clobber