-
Notifications
You must be signed in to change notification settings - Fork 256
66 lines (53 loc) · 2.27 KB
/
Copy pathcli-binary-release.yaml
File metadata and controls
66 lines (53 loc) · 2.27 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 wgc binaries
on:
release:
types: [published]
permissions:
contents: write
packages: write
jobs:
wgc-releases-matrix:
if: startsWith(github.event.release.tag_name, 'wgc@')
name: Build and release wgc binaries
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
target: [bun-linux-x64, bun-linux-arm64, bun-darwin-x64, bun-darwin-arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2
with:
cache: true
install: false
- name: Install dependencies
run: pnpm --filter ./cli --filter ./connect --filter ./shared --filter ./composition --filter ./protographic install --frozen-lockfile
- name: Build
run: pnpm --filter ./cli --filter ./connect --filter ./shared --filter ./composition --filter ./protographic run build
# The npm release sets the composition version in the postversion hook,
# binary builds skip that hook and set it here.
- name: Set composition version
working-directory: composition
run: node ./scripts/get-composition-version.mjs
- uses: winterjung/split@v2
id: split
with:
separator: '@'
msg: '${{ github.event.release.tag_name }}'
- name: 'Build wgc binary'
working-directory: cli
run: bun build --compile --minify --sourcemap --target ${{ matrix.target }} src/index.ts --outfile out/wgc-experimental-${{ steps.split.outputs._1 }}-${{ matrix.target }}
- name: 'Gzip wgc binary'
working-directory: cli
shell: bash
# the '*' here is needed to catch `.exe` files for Windows builds, if we ever add them
run: gzip -9 -v out/wgc-experimental-${{ steps.split.outputs._1 }}-${{ matrix.target }}*
- name: 'Upload build to release'
working-directory: cli
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# the '*' here is needed to catch `.exe` files for Windows builds, if we ever add them
run: gh release upload ${{ github.event.release.tag_name }} out/wgc-experimental-${{ steps.split.outputs._1 }}-${{ matrix.target }}*.gz --clobber