Skip to content

ci: add auto-publish workflow for npm releases on version bump - #3

Merged
jlucus merged 2 commits into
mainfrom
claude/dynagraph-og-rendering-4m4f85
Aug 29, 2026
Merged

ci: add auto-publish workflow for npm releases on version bump#3
jlucus merged 2 commits into
mainfrom
claude/dynagraph-og-rendering-4m4f85

Conversation

@jlucus

@jlucus jlucus commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds GitHub Actions workflow for automatic npm publishing when version bumps are merged to main via changesets.

Changes

New Workflow: .github/workflows/publish.yml

Trigger: Version bump on main (when package.json or CHANGELOG.md change)

Pipeline:

  1. Checkout code
  2. Setup Node.js 20
  3. Install dependencies
  4. Build package (npm run build)
  5. Type checking (npm run typecheck)
  6. Run benchmarks (npm run benchmark)
  7. Publish to npm (using NPM_TOKEN secret)
  8. Create GitHub Release with changelog

How It Works

Developer Flow

# 1. Developer creates changeset
npm run changeset:add

# 2. Maintainer bumps version
npm run release:version

# 3. Push to main → Automatic npm publish!
git push origin main

CI/CD Automation

  • Detects version bump from changesets
  • Runs all pre-publish checks
  • Publishes to npm registry
  • Creates GitHub Release automatically
  • No manual steps needed

Requirements

  • ✅ NPM_TOKEN secret configured (expires Nov 27, 2026)
  • ✅ Changesets configured for versioning
  • ✅ CHANGELOG automation ready

Benefits

  • 🚀 Hands-off publishing
  • ✅ Consistent build checks before publish
  • 🏷️ Automatic GitHub Releases
  • 📊 Benchmarks run on every release
  • 🔒 Uses secrets for authentication

Testing

To verify the workflow:

  1. Create changeset: npm run changeset:add
  2. Version bump: npm run release:version
  3. Push to main (or merge to main)
  4. Watch GitHub Actions run the publish workflow

Notes

  • Workflow only triggers if package.json changes (indicates version bump)
  • Requires successful build, typecheck, and benchmark to publish
  • GitHub Release created with full changelog
  • Failed checks block publishing (quality gate)

Generated by Claude Code

claude added 2 commits August 29, 2026 12:41
Creates GitHub Actions workflow that automatically publishes to npm when:
- A version bump is pushed to main (via changesets)
- All checks pass (build, typecheck, benchmark)
- NPM_TOKEN secret is configured

Workflow also creates GitHub Release with changelog automatically.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017SuCXyVCujpkbR38HjDrG7
- Remove separate auto-changelog workflow from PR events
- Integrate all release steps into single publish workflow
- Use changesets for official changelog management
- Simplified permissions and consolidated notification into main job
- Switch to softprops/action-gh-release for better release management

This eliminates workflow conflicts and ensures changelog is updated
only during version bumps (via changesets), making the release
process clearer and more maintainable.
@jlucus
jlucus merged commit 65c088e into main Aug 29, 2026
2 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.

2 participants