Skip to content

Add release-prepare workflow#114

Merged
tomusdrw merged 2 commits intomainfrom
td-release-prep-workflow
May 8, 2026
Merged

Add release-prepare workflow#114
tomusdrw merged 2 commits intomainfrom
td-release-prep-workflow

Conversation

@tomusdrw
Copy link
Copy Markdown
Member

@tomusdrw tomusdrw commented May 8, 2026

Summary

Adds .github/workflows/release-prepare.yml, a manually-triggered workflow that prepares a release end-to-end:

  • Takes a version input (e.g., 0.2.0 or v0.2.0, with or without leading v; pre-releases like 0.2.0-rc.1 are accepted).
  • Validates the input against the official semver regex.
  • Pre-flight checks that the target branch, tag, and draft release don't already exist.
  • Bumps the version of @fluffylabs/jammin, @fluffylabs/jammin-cli, and @fluffylabs/jammin-sdk via bun pm pkg set.
  • Commits to a new release/v<version> branch, pushes, and opens a PR against main.
  • Creates a draft GitHub release with tag_name=v<version>.

Once the maintainer merges the PR and then publishes the draft release, the existing publish-npm-cli.yml and publish-npm-sdk.yml workflows fire on release: published and ship the artifacts to npm.

Test plan

  • Merge this PR.
  • Trigger Release - Prepare manually with version=0.1.1-test.1 (or similar).
  • Verify the auto-opened PR diff shows only the three package.json versions changed.
  • Verify a draft release v0.1.1-test.1 exists in the Releases tab.
  • Close that PR and delete the branch + draft release without merging.
  • Re-run the workflow with a real release version when ready to ship.

🤖 Generated with Claude Code

Manually-triggered workflow that bumps the version across the three
@fluffylabs/jammin* package.json files, opens a PR against main, and
creates a draft GitHub release. Once the maintainer merges the PR and
publishes the draft release, the existing publish-npm-{cli,sdk}
workflows fire on `release: published` and ship the artifacts to npm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57a1b2a6-2c7a-4f55-ac65-a56072ab1c30

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces a new GitHub Actions workflow that automates release preparation. The workflow accepts a semantic version, normalizes it into a tag and branch name, validates that no conflicts exist, bumps versions in three package.json files using Bun, creates a release branch, drafts a GitHub release, and opens a PR back to main with release metadata.

Changes

Release Preparation Workflow

Layer / File(s) Summary
Workflow Trigger & Configuration
.github/workflows/release-prepare.yml
Workflow is manually triggered with a version input parameter, configured with required permissions for Git and GitHub operations, concurrency settings, and a fixed Bun version environment variable.
Pre-flight Validation
.github/workflows/release-prepare.yml
Version input is normalized into a v-prefixed tag and release branch name. Validation checks fail if the target release branch, tag, or GitHub release already exists.
Release Branch & Version Bumping
.github/workflows/release-prepare.yml
Git identity is configured, the release branch is created from main, package versions are bumped in root package.json, bin/cli/package.json, and packages/jammin-sdk/package.json using Bun, changes are committed, and the branch is pushed.
Release & PR Creation
.github/workflows/release-prepare.yml
A draft GitHub release is created for the computed tag, and a pull request is opened from the release branch to main with a body containing the draft release URL and a list of updated packages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • FluffyLabs/jammin#28: Both PRs add release-related automation and update package version fields in root package.json and bin/cli/package.json via GitHub Actions.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a release-prepare workflow file to the GitHub Actions configuration.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the workflow's purpose, inputs, validation, steps, and test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch td-release-prep-workflow

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release-prepare.yml:
- Around line 71-74: The current preflight treats any non-zero exit from "gh
release view $TAG" as missing release; change it to capture the command's exit
code and handle cases: if exit code is 0 -> print "Error: release '$TAG' already
exists" to stderr and exit 1; if exit code is 1 -> treat as "not found" and
continue; for any other non-zero exit -> print an operational error to stderr
including the exit code and a short hint (authentication/network/rate-limit) and
exit with that non-zero code. Implement this logic around the existing "gh
release view \"$TAG\"" invocation so the check distinguishes found (0), not
found (1), and other failures (propagate error).
- Around line 27-35: The workflow uses floating action tags actions/checkout@v4
and oven-sh/setup-bun@v1 which weakens supply-chain guarantees; update those
usages to pin to immutable commit SHAs (replace actions/checkout@v4 and
oven-sh/setup-bun@v1 with their corresponding full commit SHA refs) and apply
the same SHA pinning consistently across all workflows in the repo so the
release-prepare.yml change matches other CI files.
- Around line 99-101: Before running the git commit step (the block that runs
"git add package.json bin/cli/package.json packages/jammin-sdk/package.json" and
"git commit -m ..."), add a guard that checks for an empty diff using a command
like "git diff --quiet --exit-code" or "git status --porcelain" and, if there
are no changes, skip the commit/push and emit a clear message (e.g., "No version
changes to commit, skipping release prepare step"); ensure the workflow does not
treat this case as a failure and only runs "git commit" and "git push" when the
guard detects staged changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a1bdfca0-0bbe-453e-8b4f-dfac40b37797

📥 Commits

Reviewing files that changed from the base of the PR and between 7e35d96 and 80cfdb5.

📒 Files selected for processing (1)
  • .github/workflows/release-prepare.yml

Comment thread .github/workflows/release-prepare.yml
Comment thread .github/workflows/release-prepare.yml Outdated
Comment thread .github/workflows/release-prepare.yml
- Distinguish gh release view exit codes 0 (found), 1 (not found),
  and other (operational failure) so auth/network errors don't
  silently bypass the preflight.
- Detect empty staged diff before commit to surface a clear error
  when the target version equals the current version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomusdrw tomusdrw merged commit 9e52803 into main May 8, 2026
8 checks passed
@tomusdrw tomusdrw deleted the td-release-prep-workflow branch May 8, 2026 22:17
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