Repository navigation
62 lines (59 loc) · 2.13 KB
/
Copy pathrelease-toolchain.yml
File metadata and controls
62 lines (59 loc) · 2.13 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
name: Release one npm toolchain package
on:
workflow_dispatch:
inputs:
package:
description: Toolchain package suffix
required: true
type: choice
options:
- toolchain-clang
- toolchain-rust
- toolchain-go
- toolchain-python
- toolchain-javascript
- toolchain-java
version:
description: Exact package version to publish
required: true
type: string
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-24.04
timeout-minutes: 30
environment: npm
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
lfs: true
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271
with:
version: 10.34.5
run_install: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org/
package-manager-cache: false
- run: pnpm install --frozen-lockfile
- run: pnpm run toolchain:verify
- run: pnpm --filter "@wasm-oj/${{ inputs.package }}" run build
- run: node scripts/verify-library.mjs --package "@wasm-oj/${{ inputs.package }}"
- name: Verify requested version
env:
PACKAGE_NAME: ${{ inputs.package }}
RELEASE_VERSION: ${{ inputs.version }}
run: node -e 'const p=require(`./packages/${process.env.PACKAGE_NAME}/package.json`); if(p.version!==process.env.RELEASE_VERSION) throw new Error(`manifest is ${p.version}`)'
- name: Pack verified toolchain package
env:
PACKAGE_NAME: ${{ inputs.package }}
run: node scripts/pack-library.mjs --package "@wasm-oj/${PACKAGE_NAME}" --destination release-tarballs
- name: Publish verified toolchain tarball
env:
PACKAGE_NAME: ${{ inputs.package }}
RELEASE_VERSION: ${{ inputs.version }}
run: npm publish "./release-tarballs/wasm-oj-${PACKAGE_NAME}-${RELEASE_VERSION}.tgz" --access public