-
-
Notifications
You must be signed in to change notification settings - Fork 521
66 lines (56 loc) · 1.78 KB
/
release_wasm.yml
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
name: Release WASM
on:
workflow_dispatch:
push:
branches:
- main
paths:
- wasm/parser/package.json # Please only commit this file, so we don't need to wait for all the other CI jobs to finish.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
version_changed: ${{ steps.version.outputs.changed }}
steps:
- uses: taiki-e/checkout-action@v1
- name: Check version changes
uses: EndBug/version-check@v2
id: version
with:
static-checking: localIsNew
file-url: https://unpkg.com/@oxc-parser/wasm/package.json
file-name: wasm/parser/package.json
- name: Set version name
if: steps.version.outputs.changed == 'true'
run: |
echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})"
build:
needs: check
if: needs.check.outputs.version_changed == 'true'
name: Release WASM
runs-on: ubuntu-latest
permissions:
id-token: write # for `pnpm publish --provenance`
steps:
- uses: taiki-e/checkout-action@v1
- uses: ./.github/actions/pnpm
- uses: Boshen/setup-rust@main
with:
cache-key: "wasm"
tools: wasm-pack
- name: Build
working-directory: wasm/parser
run: |
rustup target add wasm32-unknown-unknown
pnpm run build
pnpm run test
- name: Publish
working-directory: npm/parser-wasm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --provenance --access public --no-git-checks