-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.11 KB
/
Copy pathrelease-binaries.yml
File metadata and controls
71 lines (62 loc) · 2.11 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
name: Publish standalone binaries
# Invoked by release-please.yml after a GitHub Release is created, so a single
# release produces both the npm package and the standalone binaries. The infra
# Railway proxy (`get.devicecloud.dev`) reads from the GitHub Releases API at
# runtime, so no separate manifest deploy is needed.
on:
workflow_call:
inputs:
tag_name:
description: 'Release tag to upload binaries against (e.g. v5.1.0)'
required: true
type: string
workflow_dispatch:
inputs:
tag_name:
description: 'Release tag to upload binaries against (e.g. v5.1.0). Leave blank to derive from package.json.'
required: false
type: string
jobs:
build-binaries:
runs-on: ubuntu-latest
permissions:
contents: write # Required to upload release assets
steps:
- uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v5
with:
node-version: '22.x'
cache: 'pnpm'
cache-dependency-path: './pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3'
- name: Build binaries for all platforms
run: node scripts/build-binaries.mjs
- name: Resolve release tag
id: tag
run: |
if [ -n "${{ inputs.tag_name }}" ]; then
echo "name=${{ inputs.tag_name }}" >> "$GITHUB_OUTPUT"
else
VERSION=$(node -p "require('./package.json').version")
echo "name=v${VERSION}" >> "$GITHUB_OUTPUT"
fi
- name: Upload binaries to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ steps.tag.outputs.name }}" \
dist-bin/dcd-darwin-arm64 \
dist-bin/dcd-darwin-x64 \
dist-bin/dcd-linux-arm64 \
dist-bin/dcd-linux-x64 \
dist-bin/dcd-windows-x64.exe \
dist-bin/SHA256SUMS \
--clobber