Repository navigation
ci: publish npm packages via trusted publishing, stage releases, add dry_run - #2959
Merged
Merged
Conversation
Authenticate npm publishes through GitHub OIDC instead of the NPMJS_AUTH_TOKEN secret. Nightlies publish directly with the alpha tag, releases are staged and require a maintainer approval with 2FA. - grant id-token: write to the web publish jobs - stage release publishes (npm stage publish, npm 11.15+) - add a dry_run dispatch input that runs npm with --dry-run for all web packages and skips the dotnet and kotlin jobs - match repository.url casing to CoderLine/alphaTab as required by provenance validation Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The dry_run dispatch input now applies to all platforms instead of skipping dotnet and kotlin: - web: npm publish / npm stage publish with --dry-run - dotnet: build and pack, list the nupkgs that would be pushed - kotlin: build and sign, publish to the local DistPath repository instead of Maven Central Replaces the DRY_RUN environment variable, which only printed the commands, with the --dry-run argument. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
AI-authored disclosure (
alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Issues
No issue: this changes only the build and publishing setup (CI and release infrastructure), not alphaTab's behavior. The maintainer explicitly granted the exception to the accepted-issue rule.
Proposed changes
npm trusted publishing (OIDC)
The web packages are now published using short-lived GitHub OIDC credentials instead of the long-lived
NPMJS_AUTH_TOKENsecret. A token stored in repository secrets can leak or be stolen and then used from anywhere; an OIDC credential is only issued to thepublish.ymlandrelease.ymlworkflows of this repository. npm also generates provenance attestations automatically, so consumers can verify which commit and workflow built each version.~publish_web.yml:id-token: writeon the build job,NODE_AUTH_TOKENremoved.publish.yml/release.yml: grantid-token: writeto thewebjob. A reusable workflow can't get more permissions than its caller grants.repository.urlin the five published packages:coderline/alphaTab→CoderLine/alphaTab. npm compares this to the repository the publish comes from, case-sensitively, and rejects the publish if they differ.Releases are staged and need a manual approval
publish.yml, tagalpha) still publish directly.release.yml, taglatest) runnpm stage publish. A staged version only goes live after a maintainer approves it with 2FA (npm stage approve <id>or on npmjs.com). So a compromised release build can't push alatestversion without that approval.npm@11(currently 11.21.1), because staged publishing needs npm 11.15 or newer and the npm bundled withlts/*is older.Known limitation: npm can't restrict a trusted publisher to certain dist-tags. Because the nightly entry may publish directly, it could technically also publish under
latest. Staging every nightly would close that gap, but would mean approving five packages every day.dry_runinput for manual runspublish.ymlandrelease.ymlget adry_runcheckbox that builds and verifies every platform without publishing:npm publish/npm stage publish --dry-run --loglevel verbose: does the full npm OIDC login and checks package contents, skips the upload.nupkgfiles that would be pushed (dotnet nuget pushhas no dry-run mode)DistPathMaven repository instead of Maven CentralIn
publish.yml, a dry run also forces all platforms to build, regardless of recent changes. Innightly.mts, the--dry-runargument replaces theDRY_RUNenvironment variable, which only printed the commands and wasn't used by any workflow.Verification
Dry runs of e3f4835 on all three platforms. Nothing was published; the registry dist-tags are unchanged.
Publishrun 39025727369 (nightly)Releaserun 39025730124 (staged)Successfully retrieved and set token), provenance enabled,Publishing … with tag alpha (dry-run)Staging … with tag latest (dry-run)AlphaTab/AlphaTab.Windows1.9.0-alpha.1961packed, push skippedAlphaTab/AlphaTab.Windows1.9.0packed, push skippedsignMavenPublication), published to the localDistPathrepositorysignMavenPublication), published to the localDistPathrepositoryNot covered by a dry run: whether each npm entry may publish directly or only stage. npm only checks this on a real upload, so the first real nightly and the first release will confirm it. Likewise, the NuGet API key and the Maven Central credentials are only checked on a real push.
npm configuration (done)
Each of the five packages has two trusted-publisher entries for
CoderLine/alphaTab, with no environment and dist-tag management off:publish.yml: npm publish allowedrelease.yml: stage onlyFollow-ups after merge
latesttag moved (npm view @coderline/alphatab dist-tags).NPMJS_AUTH_TOKENsecret.Checklist
AI authorship disclosure
(
alphatab-ai-authored-v1) is present at the top of this body, and I havepersonally reviewed every change and can explain each one
Further details
🤖 Generated with Claude Code