Repository navigation
ci: enable trusted publishing releases - #294
Conversation
ilteoood
left a comment
There was a problem hiding this comment.
Approved via Hermes (richiesta utente).
Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
Eomm
left a comment
There was a problem hiding this comment.
I think we miss the release:build script here:
fastify-swagger-ui/package.json
Lines 10 to 11 in caa809d
I suspect these script are not running ATM (or will not run in nodejs 27)
I thought it was for the TypeScript build—sorry 😅 |
|
ts is the main user, but here we are packing the |
ok I'm creating a PR to fix it 🙏🏻 |
Adds a manually dispatched release workflow with
patch,minor, andmajorchoices, enabling approval-gated npm trusted publishing through the shared Fastify workflow.The release job grants
id-token: writeandcontents: writeand pinsfastify/workflows/.github/workflows/reusable-release.ymltob1a11bce713bc857e52b2231fec3c89071ad3135. The shared workflow uses thereleaseenvironment, commits/pushes the version bump, publishes with npm provenance, and creates the GitHub Release.Adds
release:build: npm run prepareto generate Swagger UI static assets explicitly after dependency installation with scripts disabled. Preserves the existing prepare and prepublishOnly hooks.Part of the Lifecycle-1 rollout batch, following the pilot in fastify/fastify-accepts#231.
Validation
Local validation with Node.js 24.21.0 and npm 11.19.0:
npm install --ignore-scripts --no-audit --no-fundpassed.npm run lintpassed.npm testpassed.npm run release:buildpassed.npm pack: verified runtime entryindex.js, declaration entrytypes/index.d.ts, and unchanged package version6.1.1.Verified all required Swagger UI static files, branding files, OAuth redirect assets, and csp.json in the tarball.
Admin setup before the first release
These settings are not changed by this PR and remain unverified:
releaseenvironment with required reviewer teamfastify/releaseand deployment access exclusively for branchmain; check for extra branch/tag policies.GITHUB_TOKEN.@fastify/swagger-ui: labelmanual-gha-release, organizationfastify, repositoryfastify-swagger-ui, workflow filenamerelease.yml, environmentrelease, Allow publish enabled.No version bump, npm publication, release dispatch, or administrative settings/access changes were performed while preparing this draft.
Additional validation notes:
Separate Playwright browser E2E suite was not run locally; verify the upstream Playwright workflow before merging. The configured npm test command (unit and declarations) passed. All 12 required static files are nonempty and csp.json parses successfully.