Skip to content

ci: set up nx release with manual release and publish workflows - #1

Merged
GreedyA1 merged 1 commit into
mainfrom
ci/nx-release
Nov 3, 2026
Merged

GreedyA1 merged 1 commit into
mainfrom
ci/nx-release

Conversation

@GreedyA1

@GreedyA1 GreedyA1 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

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 last v* tag. Each release updates CHANGELOG.md, commits release: <version>, tags v<version>, pushes and creates a GitHub release.
  • .github/workflows/release.yml (new, manual): runs nx release --skip-publish as the PushBased Bot GitHub App, using GH_APP_ID and GH_APP_PRIVATE_KEY from the release environment.
  • .github/workflows/publish.yml (manual, was tag-triggered): runs nx release publish with npm trusted publishing in the release environment. It stops if HEAD isn't tagged v<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 # Changelog title goes, because Nx puts each new entry at the very top of the file.
  • README: the Releasing section describes the new flow and the one-time setup.

Both workflows are workflow_dispatch only. You run Release, then Publish, from the Actions tab, as the guide shows.

Checked locally

  • npm test passes (47/47). dist/ is unchanged, and the packed package still has the same 51 files.
  • nx release publish --first-release --dry-run would publish @push-based/tsc-diagnostics@1.0.0.
  • In a scratch clone tagged v1.0.0, a feat: and a fix: 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

  1. Install the PushBased Bot GitHub App on this repository.
  2. Add the secret GH_APP_PRIVATE_KEY to the release environment (the environment and GH_APP_ID are already set up).
  3. Run npm login, then npx nx release publish --first-release on main. After that, tag the commit v1.0.0 and create the GitHub release from the 1.0.0 changelog entry.
  4. Add the npm trusted publisher: push-based / tsc-diagnostics / publish.yml / release.

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.
@GreedyA1
GreedyA1 merged commit 94e5e17 into main Nov 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant