Skip to content

feat: add semantic-release for automated npm publishing#190

Merged
snomiao merged 1 commit into
mainfrom
sno-release
Apr 5, 2026
Merged

feat: add semantic-release for automated npm publishing#190
snomiao merged 1 commit into
mainfrom
sno-release

Conversation

@snomiao

@snomiao snomiao commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace standard-version with semantic-release for fully automated versioning
  • Add .github/workflows/release.yml that runs tests then publishes on push to main
  • npm provenance enabled via NPM_CONFIG_PROVENANCE=true
  • Conventional commits determine version bumps automatically

Test plan

  • Merge triggers release workflow on main
  • semantic-release publishes new version to npm

🤖 Generated with Claude Code

Replace standard-version with semantic-release for fully automated
versioning and npm publishing on push to main. Includes provenance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 5, 2026 08:30
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comfy-pr Ready Ready Preview, Comment Apr 5, 2026 8:32am

Request Review

@socket-security

Copy link
Copy Markdown

@snomiao
snomiao enabled auto-merge April 5, 2026 08:32
@snomiao
snomiao merged commit 05811f0 into main Apr 5, 2026
7 checks passed
@snomiao
snomiao deleted the sno-release branch April 5, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces automated npm publishing by switching the repository’s release process from a manual/version-bump flow to semantic-release driven by conventional commits, with a GitHub Actions workflow to run tests and publish on pushes to main.

Changes:

  • Replace the release script to run semantic-release.
  • Add semantic-release configuration (.releaserc.json) including changelog + git commit + GitHub release + npm publish plugins.
  • Add a Release GitHub Actions workflow that runs checks/tests, then runs semantic-release with npm provenance enabled.

Reviewed changes

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

File Description
package.json Switches release command and adds semantic-release + plugins as devDependencies.
bun.lock Updates lockfile to include semantic-release and its transitive dependency graph.
.releaserc.json Defines semantic-release branches/plugins, changelog generation, npm publish, and git asset commits.
.github/workflows/release.yml Adds CI workflow to test on push to main and then run semantic-release publishing (with provenance).

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

Comment thread package.json
"db:setup-indexes": "bun scripts/setup-performance-indexes.ts",
"prerelease": "bun run build && bun run test && vercel --prod",
"release": "bunx standard-version && npm publish",
"release": "npx semantic-release",

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

The release script invokes npx semantic-release, which can fall back to downloading and running a different semantic-release version if node_modules isn’t present/complete. To ensure the pinned dependency version is used (and avoid network installs during release), run the local binary instead (e.g., semantic-release / bunx semantic-release / npx --no-install semantic-release).

Suggested change
"release": "npx semantic-release",
"release": "semantic-release",

Copilot uses AI. Check for mistakes.
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: pip install comfy-cli setuptools

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow installs Python dependencies globally via pip install comfy-cli setuptools without the venv + pip-upgrade pattern used in other workflows (e.g. .github/workflows/test.yaml). Using a venv here would keep the runner environment consistent and reduce the chance of dependency resolution / permission issues on ubuntu-latest.

Suggested change
- run: pip install comfy-cli setuptools
- run: |
python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install comfy-cli setuptools

Copilot uses AI. Check for mistakes.
node-version: 22
registry-url: https://registry.npmjs.org
- run: bun i
- run: npx semantic-release

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

npx semantic-release may download and execute a non-pinned semantic-release version if node_modules isn’t present/complete. Prefer invoking the locally installed binary (or use npx --no-install semantic-release) to guarantee the workflow runs the version locked in package.json/bun.lock.

Suggested change
- run: npx semantic-release
- run: ./node_modules/.bin/semantic-release

Copilot uses AI. Check for mistakes.
issues: write
pull-requests: write
id-token: write

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

Consider adding a concurrency group to the Release workflow to prevent overlapping push runs on main. Without concurrency, two near-simultaneous pushes can start two semantic-release executions that race to create the same tag/publish, leading to flaky failures or duplicate attempts.

Suggested change
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

Copilot uses AI. Check for mistakes.
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