-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (123 loc) · 4.1 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (123 loc) · 4.1 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-daemon:
name: Build Daemon Bundles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 22
- run: cd daemon && pnpm install
- run: cd daemon && pnpm run bundle
- run: cd daemon && pnpm run bundle:sandbox-client
- uses: actions/upload-artifact@v4
with:
name: daemon-bundles
path: |
daemon/dist/daemon.bundle.mjs
daemon/dist/sandbox-client.js
build-binaries:
needs: build-daemon
strategy:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
binary: dev-browser-darwin-arm64
source_binary: dev-browser
- target: x86_64-apple-darwin
os: macos-latest
binary: dev-browser-darwin-x64
source_binary: dev-browser
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
binary: dev-browser-linux-x64
source_binary: dev-browser
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
binary: dev-browser-linux-arm64
cross: true
source_binary: dev-browser
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
binary: dev-browser-linux-musl-x64
cross: true
source_binary: dev-browser
- target: x86_64-pc-windows-msvc
os: windows-latest
binary: dev-browser-windows-x64.exe
source_binary: dev-browser.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: daemon-bundles
path: daemon/dist/
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross (if needed)
if: matrix.cross
run: cargo install cross
- name: Build
shell: bash
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }} --manifest-path cli/Cargo.toml
else
cargo build --release --target ${{ matrix.target }} --manifest-path cli/Cargo.toml
fi
- name: Rename binary
shell: bash
run: cp cli/target/${{ matrix.target }}/release/${{ matrix.source_binary }} ${{ matrix.binary }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}
path: ${{ matrix.binary }}
publish:
needs: build-binaries
runs-on: ubuntu-latest
permissions:
contents: write
# Required for npm trusted publishing (OIDC); also enables provenance.
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts/
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
# Trusted publishing requires npm >= 11.5.1; node 22 ships an older npm.
- run: npm install -g npm@latest
- run: cd daemon && pnpm install && pnpm run bundle && pnpm run bundle:sandbox-client
- run: |
mkdir -p dist/bin dist/scripts dist/daemon/dist
cp bin/dev-browser.js dist/bin/
cp scripts/postinstall.js dist/scripts/
cp scripts/sync-version.js dist/scripts/ 2>/dev/null || true
cp daemon/dist/daemon.bundle.mjs dist/daemon/dist/
cp daemon/dist/sandbox-client.js dist/daemon/dist/
cp package.json dist/
cp README.md dist/
cp LICENSE dist/ 2>/dev/null || true
# No NODE_AUTH_TOKEN: auth comes from the OIDC trusted publisher config.
- run: cd dist && npm publish
- uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
generate_release_notes: true