Skip to content

chore: unify npm publish workflow#1881

Merged
alexeyv merged 3 commits intobmad-code-org:mainfrom
alexeyv:release-strategy
Mar 10, 2026
Merged

chore: unify npm publish workflow#1881
alexeyv merged 3 commits intobmad-code-org:mainfrom
alexeyv:release-strategy

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 10, 2026

What

Consolidate npm publishing into a single GitHub Actions workflow.

Why

npm trusted publishing must point at one exact workflow file, so separate next/latest workflows cannot both be trusted publishers.

How

  • replace the separate next and latest publish workflows with one publish workflow
  • keep automatic next publishes on push to main
  • keep manual latest releases with a default patch bump input

alexeyv added 3 commits March 9, 2026 03:30
Add publish-next (auto-prerelease on push to main) and publish-latest
(manual stable release with Discord notification). Update CONTRIBUTING.md
to describe the trunk-based CD model.
Reject workflow_dispatch runs from non-main refs to prevent
publishing unintended code or fast-forwarding main unexpectedly.
@alexeyv alexeyv merged commit 7857b17 into bmad-code-org:main Mar 10, 2026
7 checks passed
@alexeyv alexeyv deleted the release-strategy branch March 10, 2026 03:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 10, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Introduces a new GitHub Actions workflow for automated npm publishing that triggers on pushes to main (for changes in src, tools/cli, and package.json) and supports manual version bumping via workflow dispatch. Implements prerelease publishing to npm under the "next" tag on pushes and stable release publishing to the "latest" tag on manual dispatch, with version management, git tagging, GitHub releases, and Discord notifications. Updates CONTRIBUTING.md to document this publishing behavior.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/publish.yaml
New workflow implementing automated npm publishing with conditional logic for prerelease (push to main) and stable releases (manual dispatch). Includes version derivation, dependency installation, test execution, npm publishing under appropriate tags (next/latest), git operations (commit, tag, push), GitHub release creation, and optional Discord notifications.
Documentation
CONTRIBUTING.md
Updated Target Branch guidance to reflect new publishing behavior: every push to main auto-publishes prerelease to npm under "next" tag; stable releases cut weekly to "latest" tag.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #1872: Consolidates and extends the same CI/CD/npm publishing workflows (publish-next and publish-latest flows) that were introduced earlier.
  • PR #1576: Modifies repository's release automation with CI workflow files and release-related scripts in package.json.
  • PR #1139: Modifies GitHub Actions release workflows and adjusts version-bump/publish logic for prerelease handling and release publishing.

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: consolidating npm publish workflows into a single unified workflow file.
Description check ✅ Passed The description directly explains what changes are made, why (npm trusted publishing constraint), and how (consolidating workflows while preserving behavior).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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