Skip to content

feat: add automated NPM publishing workflow with Changesets#98

Open
marcomariscal wants to merge 3 commits intomainfrom
feat/automated-publishing
Open

feat: add automated NPM publishing workflow with Changesets#98
marcomariscal wants to merge 3 commits intomainfrom
feat/automated-publishing

Conversation

@marcomariscal
Copy link
Collaborator

Summary

  • Add automated NPM publishing using Changesets
  • Streamline release process with GitHub Actions automation
  • Add changeset validation in CI for pull requests

Key Features

🚀 Automated Releases

  • One-click publishing: Merging version PR automatically publishes to NPM
  • GitHub releases: Automatic release notes from changesets
  • Beta support: Maintains existing beta workflow

📝 Changeset Workflow

  • Developer adds changeset: bun changeset for user-facing changes
  • Bot creates version PR: Automatic version bumps and changelog
  • Maintainer reviews & merges: Publishing happens automatically

CI Integration

  • Changeset validation: PR check ensures changesets for meaningful changes
  • Helpful guidance: Auto-comments when changeset needed
  • Smart detection: Ignores docs, tests, internal changes

How It Works

  1. Feature PR includes changeset file (this PR demonstrates!)
  2. Merge PR → Changesets bot creates version PR
  3. Merge version PR → Automatic NPM publish + GitHub release
  4. Stay in beta by using pre-release changesets when needed

Testing This PR

This PR includes a changeset demonstrating the workflow. When merged:

  1. Changesets bot will create a version PR
  2. That version PR will bump from 1.0.0-beta.21.0.0-beta.3
  3. Merging the version PR will publish to NPM automatically

Scripts Added

bun changeset              # Create a changeset
bun changeset:status       # Check pending changes  
bun changeset:version      # Bump versions (used by bot)
bun changeset:publish      # Publish to NPM (used by CI)

🤖 Generated with Claude Code

- Install @changesets/cli for automated version management
- Configure changesets for public package publishing
- Add GitHub Actions workflow for automated releases on main branch
- Add changeset validation in CI for pull requests
- Include changeset for this feature demonstrating the workflow
- Support beta and stable release workflows
- Streamline release process with automated version bumps

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:23 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:23 — with GitHub Actions Inactive
- Add better debugging output to understand file detection
- Skip workflow and config files that don't typically need changesets
- Fix whitespace handling in changeset file counting
- Add explicit exit code for failed checks
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:31 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:31 — with GitHub Actions Inactive
- Ensure main branch is fetched for changeset status comparison
- Add proper git ref checkout for pull request head
- Only run changeset status validation when changeset files exist
- Prevent git branch divergence errors in CI
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:39 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 18, 2025 21:39 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 26, 2025 20:30 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 26, 2025 20:30 — with GitHub Actions Inactive
@marcomariscal marcomariscal force-pushed the feat/automated-publishing branch from 66bb2a8 to 8212dbe Compare June 26, 2025 20:34
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 26, 2025 20:34 — with GitHub Actions Inactive
@marcomariscal marcomariscal temporarily deployed to Testing All Networks June 26, 2025 20:34 — with GitHub Actions Inactive
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