mirror of
https://github.com/danbulant/oxc
synced 2026-05-20 04:38:54 +00:00
66 lines
1.8 KiB
YAML
66 lines
1.8 KiB
YAML
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
|