-
Notifications
You must be signed in to change notification settings - Fork 15
239 lines (203 loc) · 7.07 KB
/
release.yml
File metadata and controls
239 lines (203 loc) · 7.07 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
create-release:
name: create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
native-prebuild:
name: native prebuild (${{ matrix.id }})
needs: create-release
runs-on: ${{ matrix.runsOn }}
strategy:
fail-fast: false
matrix:
include:
- id: linux-x64-gnu
runsOn: ubuntu-latest
rustTarget: x86_64-unknown-linux-gnu
nodeFile: rezi_ui_native.linux-x64-gnu.node
runSmoke: true
- id: darwin-x64
runsOn: macos-latest
rustTarget: x86_64-apple-darwin
nodeFile: rezi_ui_native.darwin-x64.node
runSmoke: false
- id: darwin-arm64
runsOn: macos-latest
rustTarget: aarch64-apple-darwin
nodeFile: rezi_ui_native.darwin-arm64.node
runSmoke: true
- id: win32-x64-msvc
runsOn: windows-latest
rustTarget: x86_64-pc-windows-msvc
nodeFile: rezi_ui_native.win32-x64-msvc.node
runSmoke: true
- id: win32-arm64-msvc
runsOn: windows-latest
rustTarget: aarch64-pc-windows-msvc
nodeFile: rezi_ui_native.win32-arm64-msvc.node
runSmoke: false
msvcArch: amd64_arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install
run: npm ci
- name: Setup Rust (stable)
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rustTarget }}
- name: Setup MSVC (cross)
if: runner.os == 'Windows' && matrix.id == 'win32-arm64-msvc'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvcArch }}
- name: Build prebuild
run: npx napi build --platform --release --target "${{ matrix.rustTarget }}" --js false
working-directory: packages/native
- name: Smoke test (host)
if: matrix.runSmoke
run: npm -w @rezi-ui/native run test:native:smoke
- name: Upload prebuild
uses: actions/upload-artifact@v4
with:
name: native-prebuild-${{ matrix.id }}
if-no-files-found: error
path: packages/native/${{ matrix.nodeFile }}
linux-arm64-gnu:
name: native prebuild (linux-arm64-gnu)
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build + smoke (docker, linux/arm64 glibc)
run: |
docker run --rm --platform linux/arm64 \
-v "$PWD:/w" -w /w \
node:22-bullseye bash -lc '
set -euo pipefail
apt-get update
apt-get install -y curl build-essential git
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
. "$HOME/.cargo/env"
npm ci
(cd packages/native && npx napi build --platform --release --target aarch64-unknown-linux-gnu --js false)
npm -w @rezi-ui/native run test:native:smoke
'
- name: Upload prebuild
uses: actions/upload-artifact@v4
with:
name: native-prebuild-linux-arm64-gnu
if-no-files-found: error
path: packages/native/rezi_ui_native.linux-arm64-gnu.node
publish:
name: publish (npm)
runs-on: ubuntu-latest
needs:
- native-prebuild
- linux-arm64-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Extract version from tag
id: version
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "value=$TAG" >> "$GITHUB_OUTPUT"
echo "Publishing version: $TAG"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
registry-url: https://registry.npmjs.org
- name: Install
run: npm ci
- name: Sync package versions to tag
run: node scripts/release-set-version.mjs "${{ steps.version.outputs.value }}"
- name: Build TypeScript
run: npm run build
- name: Download native prebuilds
uses: actions/download-artifact@v4
with:
path: .artifacts/native-prebuilds
merge-multiple: true
- name: Assemble binaries into packages/native
run: |
rm -f packages/native/*.node
cp .artifacts/native-prebuilds/*.node packages/native/
ls -la packages/native/*.node
- name: Verify npm pack contents + install smoke
run: node scripts/verify-native-pack.mjs
# Publish in dependency order. Separate steps so a single failure
# doesn't block the rest and each package gets its own status in the UI.
- name: Publish @rezi-ui/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w @rezi-ui/core --access public
- name: Publish @rezi-ui/native
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w @rezi-ui/native --access public
- name: Publish @rezi-ui/testkit
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w @rezi-ui/testkit --access public
- name: Publish @rezi-ui/node
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w @rezi-ui/node --access public
- name: Publish @rezi-ui/jsx
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w @rezi-ui/jsx --access public
- name: Publish @rezi-ui/ink-compat
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./packages/ink-compat --access public
- name: Publish ink-gradient-shim
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./packages/ink-gradient-shim --access public
- name: Publish ink-spinner-shim
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./packages/ink-spinner-shim --access public
- name: Publish @rezi-ui/ink-gradient-shim
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./packages/rezi-ink-gradient-shim --access public
- name: Publish @rezi-ui/ink-spinner-shim
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./packages/rezi-ink-spinner-shim --access public
- name: Publish create-rezi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish -w create-rezi --access public