Repository navigation
ci: manual npm release workflow with OIDC trusted publishing - #7
Merged
Merged
Conversation
Adds a workflow_dispatch release, modeled on NativeScript/NativeScript's secure_nx_release.yml: nx release bumps the version, writes the changelog, commits and tags; the package is built and tested, then published to npm with OIDC trusted publishing and provenance, and a GitHub release is created from the CHANGELOG entry. - publish-only input publishes the version already committed in package.json (with its hand-written CHANGELOG entry) and tags it. - Nothing is pushed until build and tests pass. - Gated by the npm-publish / npm-publish-dry-run environments; the NPM_PUBLISH_TOKEN fallback is used only when USE_NPM_TOKEN=true. - nx-release-publish publishes from dist/packages/tanstack-router, and versioning no longer bumps dependents (the demo app).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Summary
Adds
.github/workflows/secure_nx_release.yml, a manual (workflow_dispatch) release for@nativescript/tanstack-router, modeled on NativeScript/NativeScript'ssecure_nx_release.yml. It publishes to npm with OIDC trusted publishing and provenance, so no localnpm publishor long-lived token is needed.Flow
nx release <bump>bumpspackages/tanstack-router/package.json, writes the CHANGELOG entry, and commits and tags{version}-tanstack-router. All of this stays local.nx buildandnx test. Nothing is pushed until both pass.git push --atomic --follow-tags.nx release publishfromdist/packages/tanstack-routerwith OIDC (any lingering token auth is cleared first).Inputs
version0.3.0-rc.0). The npm dist-tag is derived from it.release-typepatch/minor/major→latest;prerelease→preidtag. Default ispatch.preidnext).publish-onlypackage.json, keeping its hand-written CHANGELOG entry. It refuses a version npm already has, tags HEAD, publishes, and creates the GitHub release.dry-runDifferences from the NativeScript workflow: there are no push or tag triggers (manual only), it covers a single project, it runs tests, and it has the
publish-onlymode.Config changes
project.json:nx-release-publishnow publishes fromdist/packages/{projectName}. It previously defaulted to the source folder.nx.json:release.version.generatorOptions.updateDependents: "never". Otherwise versioning also bumpsapps/demo-solid, and the changelog step fails because that project has no tags.Local checks: actionlint is clean.
nx release patch --dry-runproduces the bump, changelog, commit and tag.nx release publish --dry-runpacks fromdist.One-time setup before the first run
@nativescript/tanstack-router→ Settings → Trusted Publisher → GitHub Actions: orgNativeScript, repotanstack, workflowsecure_nx_release.yml, environmentnpm-publish.npm-publish(optionally restricted tomain), plusnpm-publish-dry-runif dry runs should be gated like in NativeScript/NativeScript. If they don't exist, GitHub creates them unprotected on first run.USE_NPM_TOKEN=truevariable and theNPM_PUBLISH_TOKENsecret.Releasing 0.2.2
After this PR and #6 (which carries
release: 0.2.2and its CHANGELOG) are merged: Actions → Release Workflow → Run workflow onmainwithpublish-onlychecked. Running once withdry-runchecked first is a good smoke test.