Repository navigation
ci: set up nx release with manual release and publish workflows - #1
Merged
Merged
Conversation
Follow the PushBased package publishing setup:
- nx.json configures Nx Release for the root package: versions from
conventional commits, v{version} tags, CHANGELOG.md and a GitHub release.
- release.yml (manual) versions, tags, pushes and creates the GitHub release
as the PushBased Bot GitHub App, using GH_APP_ID and GH_APP_PRIVATE_KEY from
the release environment.
- publish.yml (manual) runs nx release publish with npm trusted publishing,
and refuses to publish a commit that is not tagged with its version.
- The 1.0.0 changelog entry gets its date, and the title goes, because Nx
prepends each new entry at the top of the file.
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.
Sets up publishing the way the PushBased package publishing guide describes, with the zod2nx-schema workflows as the model.
What changes
nx.json+project.json: Nx Release for the root package. Versions come from conventional commits since the lastv*tag. Each release updatesCHANGELOG.md, commitsrelease: <version>, tagsv<version>, pushes and creates a GitHub release..github/workflows/release.yml(new, manual): runsnx release --skip-publishas the PushBased Bot GitHub App, usingGH_APP_IDandGH_APP_PRIVATE_KEYfrom thereleaseenvironment..github/workflows/publish.yml(manual, was tag-triggered): runsnx release publishwith npm trusted publishing in thereleaseenvironment. It stops if HEAD isn't taggedv<version>, so a commit merged after a release can't go out under the old version number.CHANGELOG.md: the 1.0.0 entry gets today's date, and the# Changelogtitle goes, because Nx puts each new entry at the very top of the file.Both workflows are
workflow_dispatchonly. You run Release, then Publish, from the Actions tab, as the guide shows.Checked locally
npm testpasses (47/47).dist/is unchanged, and the packed package still has the same 51 files.nx release publish --first-release --dry-runwould publish@push-based/tsc-diagnostics@1.0.0.v1.0.0, afeat:and afix:commit give 1.1.0, with the new changelog entry above the 1.0.0 one. With no new commits, nothing gets versioned.Still to do by hand after merging
GH_APP_PRIVATE_KEYto thereleaseenvironment (the environment andGH_APP_IDare already set up).npm login, thennpx nx release publish --first-releaseonmain. After that, tag the commitv1.0.0and create the GitHub release from the 1.0.0 changelog entry.push-based/tsc-diagnostics/publish.yml/release.