Skip to content

Add yarn release script#333

Merged
TrevorBurnham merged 2 commits intojameskerr:mainfrom
TrevorBurnham:chore/np-release-script
May 6, 2026
Merged

Add yarn release script#333
TrevorBurnham merged 2 commits intojameskerr:mainfrom
TrevorBurnham:chore/np-release-script

Conversation

@TrevorBurnham
Copy link
Copy Markdown
Collaborator

This PR adds a release script modeled after np. (np can't be used directly because it doesn't support monorepos.) The new script:

  1. Runs the prerequisite checks
  2. Bumps the version
  3. Tags the commit
  4. Pushes the commit
  5. Opens a GitHub Release draft

The tag push triggers the GitHub workflow that publishes to npm.

Usage

yarn release <patch|minor|major|X.Y.Z>

Flags: --preview, --any-branch, --no-tests, --yes.

`bin/release.mjs` runs the prerequisite checks, bumps the version,
tags, pushes, and opens a GitHub Release draft. The tag push is what
triggers `.github/workflows/publish.yml`, which publishes to npm via
Trusted Publishing (OIDC).

Usage: `yarn release <patch|minor|major|X.Y.Z>`. Flags: `--preview`,
`--any-branch`, `--no-tests`, `--yes`.
Copilot AI review requested due to automatic review settings May 5, 2026 23:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repo-root yarn release workflow (modeled after np, but monorepo-friendly) to automate version bumping, tagging, pushing, and opening a GitHub Release draft, plus updates contributor docs to match the new process.

Changes:

  • Add release script entry to the root package.json to run bin/release.mjs.
  • Replace manual release instructions in CONTRIBUTING.md with the scripted flow + flags.
  • Introduce bin/release.mjs implementing branch/cleanliness checks, version bump, commit/tag, push, and gh release draft creation.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Adds yarn release script entry pointing at the new release CLI.
CONTRIBUTING.md Documents the new scripted release process and flags.
bin/release.mjs Implements the release automation (checks, bump, commit/tag, push, draft release).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
--preview only suppresses writes (commit, tag, push, release draft);
git reads and the build still run. --any-branch skips both the main
check and the remote sync check.
@TrevorBurnham TrevorBurnham merged commit 8b67a95 into jameskerr:main May 6, 2026
1 check passed
@TrevorBurnham TrevorBurnham deleted the chore/np-release-script branch May 6, 2026 01:09
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.

2 participants