conformance/.github/workflows/ci.yml
Paul Carleton 4f91d7f324
ci: migrate to OIDC trusted publishing, add workflow_dispatch for prerelease testing (#125)
- Remove NPM_TOKEN / NODE_AUTH_TOKEN — publish now uses OIDC trusted
  publishing (no secrets needed)
- Add workflow_dispatch trigger with prerelease checkbox: publishes to
  alpha dist-tag so we can verify OIDC works without touching latest
- Drop --provenance flag (included automatically with trusted publishing)

The release event path still publishes to latest as before; the only
change is the auth mechanism.

To test: bump version to x.y.z-alpha.0 on a branch, then run workflow
with prerelease checked.
2026-01-28 15:23:41 +00:00

64 lines
1.4 KiB
YAML

on:
push:
branches:
- main
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
prerelease:
description: 'Publish as prerelease (alpha tag). Version must already be bumped in package.json on the branch.'
type: boolean
default: false
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run check
- run: npm run build
- run: npm test
publish:
runs-on: ubuntu-latest
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
environment: release
needs: [test]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: Publish to npm
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
npm publish --access public --tag alpha
else
npm publish --access public
fi