Repository navigation
Conversation
Stage a new package's first release with a stage-only token, publish later releases through npm trusted publishing, and skip versions already on npm so running again is safe. Replaces the old release workflow.
itvi-1234
marked this pull request as draft
December 3, 2026 18:24
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.
Publish the plugin to npm, the same way as the extensions repo
This adds a manual workflow that publishes both packages to npm:
@runtimeconditions/plugin-runtime-conditions(frontend)@runtimeconditions/plugin-runtime-conditions-backend(backend)How it works
Both packages must have the same version in their
package.json. For each package:NPM_STAGE_TOKENsecret. A maintainer approves it on npmjs.com under Staged Packages.Every package is checked before anything is published, so a missing token stops the run before it publishes only one of the two.
Changes
.github/workflows/publish-npm.yml: run it by hand from the Actions tab, with a dry run option. It runs only frommain. When something is released, it also creates thev<version>GitHub release.scripts/publish-npm.mjswith tests inscripts/publish-npm.test.mjs. CI runs them.release.yml.0.1.0.docs/releases.mdwith the one-time setup.One-time setup (maintainer)
Create a granular npm token, Read and write (stage only), scoped to
@runtimeconditions. Save it as theNPM_STAGE_TOKENrepo secret.Run the workflow and approve both staged packages on npmjs.com.
Add the trusted publisher for both packages (asks for 2FA):
for p in @runtimeconditions/plugin-runtime-conditions @runtimeconditions/plugin-runtime-conditions-backend; do
npm trust github "$p" --file publish-npm.yml --repo runtimeconditions/backstage-plugin --allow-publish --allow-stage-publish --yes
done
After that, later releases need no token.