mirror of
https://github.com/danbulant/oxc
synced 2026-05-21 13:18:59 +00:00
75 lines
2.2 KiB
YAML
75 lines
2.2 KiB
YAML
name: Release WASM
|
|
|
|
permissions: {}
|
|
|
|
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@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
|
|
|
|
- name: Check version changes
|
|
uses: EndBug/version-check@36ff30f37c7deabe56a30caa043d127be658c425 # 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'
|
|
env:
|
|
VERSION_NUMBER: ${{ steps.version.outputs.version }}
|
|
VERSION_TYPE: ${{ steps.version.outputs.version_type }}
|
|
run: |
|
|
echo "Version change found! New version: ${VERSION_NUMBER} (${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@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
|
|
|
|
- uses: ./.github/actions/pnpm
|
|
|
|
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
|
|
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: Check
|
|
working-directory: npm/parser-wasm
|
|
run: pnpm run check
|
|
|
|
- name: Publish
|
|
working-directory: npm/parser-wasm
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: pnpm publish --provenance --access public --no-git-checks
|