Skip to content

Conversation

@pyrotank41
Copy link
Owner

πŸš€ Production-Ready Release Automation

New GitHub Actions Workflows

1. npm-publish.yml (Release β†’ npm)

Trigger: When GitHub Release is published
Steps:

  • βœ… Run all 237 tests (must pass!)
  • βœ… Build TypeScript package
  • βœ… Validate version matches release tag
  • βœ… Verify build output exists
  • βœ… Check if version already published (warning)
  • βœ… Publish to npm with provenance
  • βœ… Success notification

Safety Features:

  • Tests must pass before publish
  • Version validation (package.json vs tag)
  • Build verification
  • npm provenance for security
  • Main branch only

2. ci.yml (PR/Push Testing)

Trigger: PRs and pushes to main
Matrix: Node 18 and Node 20
Steps:

  • βœ… Install dependencies
  • βœ… Run all tests
  • βœ… Build package
  • βœ… Verify build output
  • βœ… Check TypeScript compilation

Ensures code quality before merging!

Documentation

NPM_PUBLISH_SETUP.md

Complete setup guide covering:

  • One-time npm token setup
  • Simple 3-step release process using npm version
  • GitHub CLI and UI workflows
  • Pre-release checklist
  • Safety features explanation
  • Troubleshooting guide
  • Version numbering (semver)
  • Complete example for v2.0.0 release

CHANGELOG.md

Initial changelog with:

  • v2.0.0 release notes (planned for Dec 21, 2025)
  • Complete list of breaking changes
  • All 3 PRDs documented
  • Migration guide reference
  • Historical versions (1.0.0 - 1.3.0)

Release Workflow (Recommended)

# 1. Bump version (auto-creates commit + tag)
npm version major -m "chore: release v%s"

# 2. Push to GitHub (including tags)
git push origin main --follow-tags

# 3. Create GitHub Release (triggers workflow)
gh release create v2.0.0 --generate-notes

That's it! GitHub Action handles the rest:

  • Tests β†’ Build β†’ Validate β†’ Publish to npm πŸš€

Why This Approach?

βœ… Industry Standard - Used by Zustand, SWR, React Hook Form, etc. βœ… Simple - 3 commands, fully automated
βœ… Safe - Multiple validation steps
βœ… Intentional - Manual release creation prevents accidents βœ… Auditable - GitHub Release notes + npm provenance βœ… Flexible - Easy to evolve with future needs

Files Added

  • .github/workflows/npm-publish.yml (101 lines)
  • .github/workflows/ci.yml (74 lines)
  • .github/NPM_PUBLISH_SETUP.md (267 lines)
  • CHANGELOG.md (139 lines)

Ready for v2.0.0 release on December 21, 2025! πŸŽ‰

πŸš€ **Production-Ready Release Automation**

## New GitHub Actions Workflows

### 1. npm-publish.yml (Release β†’ npm)
**Trigger:** When GitHub Release is published
**Steps:**
- βœ… Run all 237 tests (must pass!)
- βœ… Build TypeScript package
- βœ… Validate version matches release tag
- βœ… Verify build output exists
- βœ… Check if version already published (warning)
- βœ… Publish to npm with provenance
- βœ… Success notification

**Safety Features:**
- Tests must pass before publish
- Version validation (package.json vs tag)
- Build verification
- npm provenance for security
- Main branch only

### 2. ci.yml (PR/Push Testing)
**Trigger:** PRs and pushes to main
**Matrix:** Node 18 and Node 20
**Steps:**
- βœ… Install dependencies
- βœ… Run all tests
- βœ… Build package
- βœ… Verify build output
- βœ… Check TypeScript compilation

**Ensures code quality before merging!**

## Documentation

### NPM_PUBLISH_SETUP.md
Complete setup guide covering:
- One-time npm token setup
- Simple 3-step release process using `npm version`
- GitHub CLI and UI workflows
- Pre-release checklist
- Safety features explanation
- Troubleshooting guide
- Version numbering (semver)
- Complete example for v2.0.0 release

### CHANGELOG.md
Initial changelog with:
- v2.0.0 release notes (planned for Dec 21, 2025)
- Complete list of breaking changes
- All 3 PRDs documented
- Migration guide reference
- Historical versions (1.0.0 - 1.3.0)

## Release Workflow (Recommended)

```bash
# 1. Bump version (auto-creates commit + tag)
npm version major -m "chore: release v%s"

# 2. Push to GitHub (including tags)
git push origin main --follow-tags

# 3. Create GitHub Release (triggers workflow)
gh release create v2.0.0 --generate-notes
```

**That's it!** GitHub Action handles the rest:
- Tests β†’ Build β†’ Validate β†’ Publish to npm πŸš€

## Why This Approach?

βœ… **Industry Standard** - Used by Zustand, SWR, React Hook Form, etc.
βœ… **Simple** - 3 commands, fully automated
βœ… **Safe** - Multiple validation steps
βœ… **Intentional** - Manual release creation prevents accidents
βœ… **Auditable** - GitHub Release notes + npm provenance
βœ… **Flexible** - Easy to evolve with future needs

## Files Added

- .github/workflows/npm-publish.yml (101 lines)
- .github/workflows/ci.yml (74 lines)
- .github/NPM_PUBLISH_SETUP.md (267 lines)
- CHANGELOG.md (139 lines)

Ready for v2.0.0 release on December 21, 2025! πŸŽ‰
@pyrotank41 pyrotank41 merged commit 73fb463 into main Dec 18, 2025
0 of 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