Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
context:
name: "Context"
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
outputs:
trigger: ${{ steps.ctx.outputs.trigger }}
version: ${{ steps.ctx.outputs.version }}
Expand All @@ -98,6 +101,9 @@ jobs:
- id: ctx
name: Resolve publish context
run: pnpm --filter=publish exec tsx src/ci/bin.ts context-output
- name: Check npm trusted publishing
if: steps.ctx.outputs.trigger == 'release'
run: pnpm --filter=publish exec tsx src/ci/bin.ts check-npm-oidc

# ---------------------------------------------------------------------------
# build — matrix of native/engine artifacts
Expand Down Expand Up @@ -443,7 +449,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "24"
node-version: "24.20.0"
registry-url: "https://registry.npmjs.org"
cache: pnpm
- run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -624,11 +630,18 @@ jobs:

- name: Publish npm packages
env:
# setup-node provides a dummy token value; clear it so token-only
# post-publish operations stay disabled for trusted publishing.
NODE_AUTH_TOKEN: ""
SKIP_WASM_BUILD: "1"
run: |
# setup-node writes an auth token placeholder into npmrc. Remove it
# so npm uses the GitHub OIDC credentials for trusted publishing.
if [ -f "${NPM_CONFIG_USERCONFIG:-}" ]; then
sed -i '/:_authToken=/d' "$NPM_CONFIG_USERCONFIG"
fi
unset NODE_AUTH_TOKEN
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
echo "GitHub OIDC token request is unavailable" >&2
exit 1
fi
pnpm --filter=publish exec tsx src/ci/bin.ts publish-npm \
--tag ${{ needs.context.outputs.npm_tag }} \
--parallel 16 \
Expand Down
Loading
Loading