Skip to content

Improve release process for squash merge workflow#4

Merged
waynebrantley merged 2 commits intomainfrom
feat/improve-release-process
Feb 1, 2026
Merged

Improve release process for squash merge workflow#4
waynebrantley merged 2 commits intomainfrom
feat/improve-release-process

Conversation

@waynebrantley
Copy link
Copy Markdown
Owner

Summary

Updates the release process to properly handle squash merges, ensuring tags always point to the same commit as main.

Problem

Previously, the release script would:

  1. Create a tag on the release branch commit
  2. Push the tag
  3. PR gets squash-merged, creating a NEW commit
  4. Tag points to old commit, main points to new commit ❌

Solution

Split the release process into two steps:

Step 1: release.sh

  • Creates release branch with version bump
  • Creates PR for review
  • Waits for tests and merge
  • Does NOT create tag yet

Step 2: finalize-release.sh (after PR merge)

  • Runs on main after PR is merged
  • Creates tag on the merged (squashed) commit ✅
  • Creates GitHub release
  • Triggers npm publish workflow

Benefits

  • Tags and main always aligned
  • Works seamlessly with branch protection
  • Works with squash merge strategy
  • Automated tag creation on correct commit

Testing

  • Scripts have correct permissions
  • .gitignore updated for .release-temp/
  • Line endings preserved (LF)

Workflow Example

# Start release
./scripts/release.sh patch

# Wait for PR to merge...

# Finalize release (creates tag + GitHub release)
./scripts/finalize-release.sh

## Changes

### Updated release.sh
- Creates a release branch instead of pushing to main
- Creates a PR for the version bump
- Defers tag creation until after PR merge
- Saves release state for finalize step

### New finalize-release.sh
- Runs after PR is merged
- Creates tag on the correct squashed commit
- Creates GitHub release
- Ensures tag and main are aligned

### Workflow
1. Run: ./scripts/release.sh [type]
   - Creates PR with version bump
   - Waits for tests and merge

2. After PR merge, run: ./scripts/finalize-release.sh
   - Creates tag on merged commit
   - Creates GitHub release
   - Triggers npm publish

This ensures tags always point to the same commit as main,
even with squash merges.
- Stable releases (patch/minor/major) must be from main
- Pre-releases (beta/alpha) can be from any branch
- Pre-releases create tag immediately (no PR workflow)
- Stable releases use PR workflow with finalize step
@waynebrantley waynebrantley merged commit 5d781e1 into main Feb 1, 2026
1 check passed
@waynebrantley waynebrantley deleted the feat/improve-release-process branch February 1, 2026 19:09
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