Files
oxc-project__oxc/.github/workflows/reusable_release_napi.yml
renovate[bot] b79db0c08f chore(deps): update github actions (#25752)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [CodSpeedHQ/action](https://redirect.github.com/CodSpeedHQ/action) |
action | patch | `v5.0.2` → `v5.0.3` | |
|
[cross-platform-actions/action](https://redirect.github.com/cross-platform-actions/action)
| action | minor | `v1.3.0` → `v1.4.0` | |
|
[semgrep/semgrep](https://redirect.github.com/semgrep/semgrep-proprietary)
| container | minor | `1.172.0` → `1.173.0` | |
|
[taiki-e/install-action](https://redirect.github.com/taiki-e/install-action)
| action | patch | `v2.85.9` → `v2.85.13` | `v2.86.1` (+2) |

---

### Release Notes

<details>
<summary>CodSpeedHQ/action (CodSpeedHQ/action)</summary>

###
[`v5.0.3`](https://redirect.github.com/CodSpeedHQ/action/releases/tag/v5.0.3)

[Compare
Source](https://redirect.github.com/CodSpeedHQ/action/compare/v5.0.2...v5.0.3)

Bumps the CodSpeed runner to
[v5.0.2](https://redirect.github.com/CodSpeedHQ/codspeed/releases/tag/v5.0.2).

##### 🐛 Bug Fixes

- Retry complete pinned binary downloads by
[@&#8203;art049](https://redirect.github.com/art049) in
[#&#8203;499](https://redirect.github.com/CodSpeedHQ/codspeed/pull/499)
- Accept `--exclude-allocations` and `--cycle-estimation` without a
value by
[@&#8203;not-matthias](https://redirect.github.com/not-matthias)

**Full Runner Changelog**:
<https://github.com/CodSpeedHQ/codspeed/blob/main/CHANGELOG.md>

#### What's Changed

- chore: bump runner version to 5.0.2 by
[@&#8203;github-actions](https://redirect.github.com/github-actions)\[bot]
in [#&#8203;230](https://redirect.github.com/CodSpeedHQ/action/pull/230)

**Full Changelog**:
<https://github.com/CodSpeedHQ/action/compare/v5.0.2...v5.0.3>

</details>

<details>
<summary>cross-platform-actions/action
(cross-platform-actions/action)</summary>

###
[`v1.4.0`](https://redirect.github.com/cross-platform-actions/action/releases/tag/v1.4.0):
Cross Platform Action 1.4.0

[Compare
Source](https://redirect.github.com/cross-platform-actions/action/compare/v1.3.0...v1.4.0)

##### Added

- Add support for FreeBSD on RISC-V 64 (`riscv64`)
([#&#8203;36](https://redirect.github.com/cross-platform-actions/action/issues/36))
- Add support for NetBSD on VAX, running on the SIMH simulator
- Add support for NetBSD 11.0
([#&#8203;154](https://redirect.github.com/cross-platform-actions/action/issues/154))

##### Changed

- OpenBSD on ARM64 now boots with the same EDK II UEFI firmware
(`uefi.fd`) as
every other ARM64 guest, instead of a separate Linaro UEFI build. The
QEMU
machine type for OpenBSD on ARM64 is now `virt,acpi=off`, which makes
the
kernel fall back to the device tree instead of hanging during ACPI
attach.
This removes the dependency on the Linaro release server, which no
longer
  exists

##### Fixed

- Don't log the `Tearing down VM` group when `shutdown_vm` is `false`,
since
  the VM is not being torn down in that case

([#&#8203;109](https://redirect.github.com/cross-platform-actions/action/issues/109))
- The "Start VM" step could keep running for hours when the VM failed to
boot

([#&#8203;158](https://redirect.github.com/cross-platform-actions/action/issues/158)).
Waiting for the VM to become ready is now bounded by an actual wall
clock
timeout, instead of by a number of connection attempts, and a single SSH
  connection attempt is bounded by `ConnectTimeout`.
- The post job step now reports when the console log of the VM is
missing or
  empty, instead of silently printing nothing

([#&#8203;158](https://redirect.github.com/cross-platform-actions/action/issues/158))
- A reboot of a guest that dies instead of rebooting now fails after
roughly
20 seconds, instead of after 13 minutes. The SSH session that issues the
reboot is bounded by `ServerAliveInterval`, so it no longer blocks for
the
full TCP retransmission time, and waiting for the VM to come back up is
given up on as soon as the guest announces a kernel panic on its serial
  console
- Advanced Matrix Extensions (AMX) is no longer exposed to the guests on
x86-64, so which runner a job happens to get no longer decides whether
the
  VM boots

([#&#8203;158](https://redirect.github.com/cross-platform-actions/action/issues/158)).
Kernels released before AMX existed fault as soon as userland starts,
which
affected NetBSD 9.4 and 10.1 and FreeBSD 12.4 on the runners that have
it

</details>

<details>
<summary>taiki-e/install-action (taiki-e/install-action)</summary>

###
[`v2.85.13`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.85.13):
2.85.13

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.85.12...v2.85.13)

- Update `tombi@latest` to 1.3.3.

- Update `mise@latest` to 2026.8.5.

- Update `kingfisher@latest` to 1.113.0.

- Update `cargo-shear@latest` to 1.13.4.

- Update `bpf-linker@latest` to 0.11.0.

###
[`v2.85.12`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.85.12):
2.85.12

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.85.11...v2.85.12)

- Update `zola@latest` to 0.23.3.

- Update `wasm-tools@latest` to 1.256.0.

- Update `tombi@latest` to 1.2.10.

- Update `syft@latest` to 1.51.0.

- Update `prek@latest` to 0.4.13.

- Update `mise@latest` to 2026.8.4.

- Update `editorconfig-checker@latest` to 3.11.1.

- Update `cargo-tarpaulin@latest` to 0.37.1.

- Update `cargo-rdme@latest` to 2.2.1.

- Update `biome@latest` to 2.5.8.

###
[`v2.85.11`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.85.11):
2.85.11

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.85.10...v2.85.11)

- Update `zola@latest` to 0.23.2.

- Update `wasm-bindgen@latest` to 0.2.127.

- Update `uv@latest` to 0.12.3.

- Update `osv-scanner@latest` to 2.5.0.

- Update `mise@latest` to 2026.8.3.

- Update `kingfisher@latest` to 1.112.0.

- Update `editorconfig-checker@latest` to 3.10.0.

###
[`v2.85.10`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.85.10):
2.85.10

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.85.9...v2.85.10)

- Update `uv@latest` to 0.12.2.

- Update `tombi@latest` to 1.2.7.

- Update `cosign@latest` to 3.1.3.

- Update `coreutils@latest` to 0.10.0.

- Update `cargo-rdme@latest` to 2.2.0.

- Update `cargo-crap@latest` to 0.4.3.

</details>

---

### Configuration

📅 **Schedule**: (in timezone Asia/Shanghai)

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yOS41IiwidXBkYXRlZEluVmVyIjoiNDQuMjkuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-16 17:08:56 +00:00

261 lines
9.2 KiB
YAML

name: Release NAPI
permissions: {}
on:
workflow_call:
inputs:
name:
required: true
type: string
description: "The component name"
jobs:
check:
name: Check version
runs-on: ubuntu-slim
outputs:
version_changed: ${{ steps.check.outputs.version_changed }}
env:
name: ${{ inputs.name }}
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: ./.github/actions/check-version
id: check
with:
file-name: napi/${{ inputs.name }}/package.json
file-url: https://unpkg.com/oxc-${{ inputs.name }}@latest/package.json
build:
needs: check
if: needs.check.outputs.version_changed == 'true'
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
name: ${{ inputs.name }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
build: pnpm build --target x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
build: pnpm build --target aarch64-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: pnpm build --target x86_64-unknown-linux-gnu --use-napi-cross
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
build: pnpm build --target x86_64-unknown-linux-musl -x
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: pnpm build --target aarch64-unknown-linux-gnu --use-napi-cross
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
build: pnpm build --target aarch64-unknown-linux-musl -x
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
build: pnpm build --target armv7-unknown-linux-gnueabihf --use-napi-cross
- os: macos-latest
target: x86_64-apple-darwin
build: pnpm build --target x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
build: pnpm build --target aarch64-apple-darwin
- os: ubuntu-latest
target: wasm32-wasip1-threads
build: pnpm build-wasm
- os: ubuntu-latest
target: s390x-unknown-linux-gnu
build: |
export CFLAGS="-fuse-ld=lld"
pnpm build --target s390x-unknown-linux-gnu --use-napi-cross
- os: ubuntu-latest
target: aarch64-linux-android
build: pnpm build --target aarch64-linux-android
- os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
build: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
export TARGET_CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++
pnpm build --target riscv64gc-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-ohos
build: pnpm build --target aarch64-unknown-linux-ohos
- os: ubuntu-latest
target: armv7-linux-androideabi
build: pnpm build --target armv7-linux-androideabi
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
build: pnpm build --target armv7-unknown-linux-musleabihf -x
- os: windows-latest
target: i686-pc-windows-msvc
build: pnpm build --target i686-pc-windows-msvc
- os: ubuntu-latest
target: powerpc64le-unknown-linux-gnu
build: pnpm build --target powerpc64le-unknown-linux-gnu --use-napi-cross
- os: ubuntu-latest
target: riscv64gc-unknown-linux-musl
build: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
export TARGET_CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++
pnpm build --target riscv64gc-unknown-linux-musl -x
steps:
- if: ${{ contains(matrix.os, 'windows') }}
run: git config --system core.longpaths true
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: oxc-project/setup-node@d59b270414aa7d0eed947eed4eb5b0b8a675f01d # v1.4.0
- run: rustup target add ${{ matrix.target }}
- name: Setup OpenHarmony SDK
if: ${{ contains(matrix.target, 'ohos') }}
uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0
- uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
if: ${{ contains(matrix.target, 'musl') }}
with:
version: 0.13.0
- name: Build
working-directory: napi/${{ inputs.name }}
run: ${{ matrix.build }}
shell: bash
env:
# `clang` lacks the `__ldar64`/`__stlr64` MSVC intrinsics that mimalloc's
# atomic.h uses on the ARM64 MSVC C path, so leave TARGET_CC unset on
# `*-pc-windows-msvc` targets and let cc-rs pick `cl.exe`.
TARGET_CC: ${{ !contains(matrix.target, 'pc-windows-msvc') && 'clang' || '' }} # for mimalloc
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
if-no-files-found: error
name: bindings-${{ matrix.target }}
# `**/*.node` because in `napi/parser`, binaries are in `src-js` subdirectory
path: |
napi/${{ inputs.name }}/**/*.node
napi/${{ inputs.name }}/**/*.wasm
build-freebsd:
needs: check
if: needs.check.outputs.version_changed == 'true'
name: Build FreeBSD
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- name: Build
id: build
uses: cross-platform-actions/action@24ef01df165c76df1ed2b9f9e9212e78dc2fc963 # v1.4.0
env:
DEBUG: napi:*
RUSTUP_IO_THREADS: 1
with:
operating_system: freebsd
version: "14.2"
memory: 8G
cpu_count: 3
environment_variables: "DEBUG RUSTUP_IO_THREADS"
shell: bash
run: |
sudo pkg install -y -f curl libnghttp2 node22 npm cmake ca_root_nss
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
pwd
ls -lah
whoami
env
cd napi/${{ inputs.name }}
export COREPACK_INTEGRITY_KEYS=0
sudo corepack enable
pnpm install --ignore-scripts # postinstall: The current platform (freebsd) and architecture (x64) is not supported.
pnpm build --target x86_64-unknown-freebsd
rm -rf node_modules
rm -rf target
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
if-no-files-found: error
name: bindings-freebsd
# `**/*.node` because in `napi/parser`, binary is in `src-js` subdirectory
path: napi/${{ inputs.name }}/**/*.node
publish:
name: Publish NAPI
needs:
- build
- build-freebsd
runs-on: ubuntu-slim
permissions:
id-token: write # for `pnpm publish --provenance`
env:
name: ${{ inputs.name }}
package_path: napi/${{ inputs.name }}
npm_dir: release-dir
PUBLISH_FLAGS: "--provenance --access public --no-git-checks"
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: oxc-project/setup-node@d59b270414aa7d0eed947eed4eb5b0b8a675f01d # v1.4.0
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: artifacts
- run: mkdir -p ${npm_dir}
- run: pnpm napi create-npm-dirs --package-json-path ${package_path}/package.json --npm-dir ${npm_dir}
- run: pnpm napi artifacts --package-json-path ${package_path}/package.json --build-output-dir ${package_path}/src-js --npm-dir ${npm_dir}
if: ${{ inputs.name == 'parser' }}
- run: pnpm napi artifacts --package-json-path ${package_path}/package.json --build-output-dir ${package_path} --npm-dir ${npm_dir}
if: ${{ inputs.name != 'parser' }}
- run: pnpm -C ${package_path} build-browser-bundle --npmDir ../../${npm_dir}
if: ${{ inputs.name == 'parser' }}
- name: Check Publish
run: node .github/scripts/check-npm-packages.js "${npm_dir}/*" "${package_path}"
- name: Trusted Publish
run: |
# Trusted publishing is configured, publish token is not required.
# Publish sub-packages and adds `optionalDependencies` to `package_path`.
pnpm napi pre-publish --no-gh-release -t npm --package-json-path ${package_path}/package.json --npm-dir ${npm_dir}
bash .github/scripts/publish-if-needed.sh ${package_path} ${PUBLISH_FLAGS}