forked from open-wallet-standard/core
-
Notifications
You must be signed in to change notification settings - Fork 0
401 lines (329 loc) · 12 KB
/
Copy pathrelease.yml
File metadata and controls
401 lines (329 loc) · 12 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
asset: ows-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
asset: ows-linux-aarch64
- target: x86_64-apple-darwin
os: macos-latest
asset: ows-darwin-x86_64
- target: aarch64-apple-darwin
os: macos-latest
asset: ows-darwin-aarch64
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ows
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Rust toolchain
run: |
rustup update stable
rustup target add ${{ matrix.target }}
- name: Install zig
if: contains(matrix.target, 'linux')
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
with:
version: 0.13.0
- name: Install cargo-zigbuild
if: contains(matrix.target, 'linux')
uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2.68.35
with:
tool: cargo-zigbuild
- name: Build (Linux - glibc 2.17+)
if: contains(matrix.target, 'linux')
run: cargo zigbuild --release --target ${{ matrix.target }}.2.17
- name: Build (macOS)
if: "!contains(matrix.target, 'linux')"
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary
run: cp target/${{ matrix.target }}/release/ows ${{ matrix.asset }}
- name: Upload artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.asset }}
path: ows/${{ matrix.asset }}
python-wheels:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: |
3.9
3.10
3.11
3.12
3.13
- name: Set version from tag
run: |
V="${GITHUB_REF_NAME#v}"
"$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --python
- name: Build wheels
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13
sccache: "true"
manylinux: auto
working-directory: bindings/python
- name: Upload wheels
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: python-wheel-${{ matrix.target }}
path: bindings/python/dist/*.whl
publish-pypi:
needs: python-wheels
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: python-wheel-*
merge-multiple: true
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
node-addons:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: bindings/node
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
- name: Install Rust toolchain
run: |
rustup update stable
rustup target add ${{ matrix.target }}
- name: Install zig
if: contains(matrix.target, 'linux')
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
with:
version: 0.13.0
- name: Install cargo-zigbuild
if: contains(matrix.target, 'linux')
uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2.68.35
with:
tool: cargo-zigbuild
- name: Set version from tag
run: |
V="${GITHUB_REF_NAME#v}"
"$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --node
- name: Install dependencies
run: npm install --ignore-scripts
- name: Create zig CC wrapper with proper argument quoting
if: contains(matrix.target, 'linux')
run: |
ZIG_TARGET=$(echo "${{ matrix.target }}" | sed 's/-unknown//')
mkdir -p /tmp/zig-wrappers
printf '#!/bin/bash\nexec zig cc "$@" -target %s.2.17\n' "$ZIG_TARGET" > /tmp/zig-wrappers/cc.sh
chmod +x /tmp/zig-wrappers/cc.sh
CC_VAR="CC_$(echo "${{ matrix.target }}" | tr '-' '_')"
echo "${CC_VAR}=/tmp/zig-wrappers/cc.sh" >> "$GITHUB_ENV"
- name: Build native addon (Linux - glibc 2.17+)
if: contains(matrix.target, 'linux')
run: npx napi build --platform --release --target ${{ matrix.target }} --zig --zig-abi-suffix 2.17
- name: Build native addon (macOS)
if: "!contains(matrix.target, 'linux')"
run: npx napi build --platform --release --target ${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: node-addon-${{ matrix.target }}
path: |
bindings/node/*.node
bindings/node/index.js
bindings/node/index.d.ts
publish-npm:
needs: [node-addons, build]
runs-on: ubuntu-latest
environment: release
defaults:
run:
working-directory: bindings/node
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Set version from tag
run: |
V="${GITHUB_REF_NAME#v}"
"$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --node
- name: Install dependencies
run: npm install --ignore-scripts
- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: node-addon-*
merge-multiple: true
path: bindings/node/artifacts
- name: Move artifacts to platform packages
run: |
npx napi artifacts --dir artifacts
cp artifacts/index.js . 2>/dev/null || true
cp artifacts/index.d.ts . 2>/dev/null || true
- name: Verify index.js exists
run: |
if [ ! -f index.js ] || [ ! -f index.d.ts ]; then
echo "ERROR: index.js or index.d.ts missing — npm package would be broken"
exit 1
fi
- name: Download CLI binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: ows-*
merge-multiple: true
path: bindings/node/cli-binaries
- name: Copy CLI binaries into platform packages
run: |
cp cli-binaries/ows-darwin-aarch64 npm/darwin-arm64/ows && chmod +x npm/darwin-arm64/ows
cp cli-binaries/ows-darwin-x86_64 npm/darwin-x64/ows && chmod +x npm/darwin-x64/ows
cp cli-binaries/ows-linux-x86_64 npm/linux-x64-gnu/ows && chmod +x npm/linux-x64-gnu/ows
cp cli-binaries/ows-linux-aarch64 npm/linux-arm64-gnu/ows && chmod +x npm/linux-arm64-gnu/ows
- name: Publish platform packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for dir in npm/*/; do
output=$(npm publish "$dir" --access public 2>&1) || {
if echo "$output" | grep -qi "cannot publish over\|previously published"; then
echo "Already published: $dir — skipping"
else
echo "Failed to publish $dir"
echo "$output"
exit 1
fi
}
done
- name: Publish main package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --ignore-scripts
publish-npm-adapters:
needs: publish-npm
runs-on: ubuntu-latest
environment: release
defaults:
run:
working-directory: bindings/node-adapters
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Set version from tag
run: |
V="${GITHUB_REF_NAME#v}"
"$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --node
- name: Install dependencies
run: npm install --ignore-scripts
- name: Publish adapters package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --ignore-scripts
publish-crates:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: ows
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- name: Install Rust toolchain
run: rustup update stable
- name: Set version from tag
run: |
V="${GITHUB_REF_NAME#v}"
"$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --rust
- name: Publish ows-core
run: cargo publish -p ows-core --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_REGISTRY_TOKEN }}
- name: Publish ows-signer
run: cargo publish -p ows-signer --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_REGISTRY_TOKEN }}
- name: Publish ows-lib
run: cargo publish -p ows-lib --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_REGISTRY_TOKEN }}
- name: Publish ows-pay
run: cargo publish -p ows-pay --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_REGISTRY_TOKEN }}
- name: Publish ows-cli
run: cargo publish -p ows-cli --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_REGISTRY_TOKEN }}
sbom:
uses: ./.github/workflows/sbom.yml
release:
needs: [build, sbom]
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: ows-*
merge-multiple: true
- name: Download SBOMs
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: sbom
path: sbom
- name: Package SBOMs
run: tar czf sbom.tar.gz -C sbom .
- name: Create release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
generate_release_notes: true
files: |
ows-*
sbom.tar.gz