-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 2 KB
/
Copy pathbinary-release.yml
File metadata and controls
66 lines (54 loc) · 2 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
name: Build and Release Binaries
on:
release:
types:
- published
jobs:
build-binaries:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux-x64
- os: ubuntu-latest
target: linux-arm64
- os: macos-latest
target: darwin-x64
- os: macos-latest
target: darwin-arm64
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Update package.json version
run: |
VERSION="${GITHUB_REF_NAME#v}"
jq --arg v "$VERSION" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json
- name: Build web assets
run: bun run build
- name: Build standalone binary
run: bun run build-binary.ts --target=bun-${{ matrix.target }} --outfile=dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}
- name: Generate checksum
working-directory: dist
run: shasum -a 256 link-cli-${{ github.ref_name }}-${{ matrix.target }} > link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: link-cli-${{ github.ref_name }}-${{ matrix.target }}
path: |
dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}
dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256
if-no-files-found: error
- name: Upload binary to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} dist/link-cli-${{ github.ref_name }}-${{ matrix.target }} dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256 --clobber