Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ on:
workflow_dispatch:
inputs:
release-type:
description: "Release type (patch/minor/major)"
description: "Release type — 'auto' derives it from conventional commits since the last tag"
type: choice
required: true
options:
- auto
- patch
- minor
- major
default: patch
default: auto
prerelease:
description: "Prerelease channel (or 'none' for stable)"
type: choice
Expand Down Expand Up @@ -271,7 +272,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
run: |
ARGS="${{ inputs.release-type }} --ci"
# 'auto' → pass no increment so @release-it/conventional-changelog derives
# the bump (feat→minor, fix→patch, BREAKING/! →major) from the commits since
# the last tag. patch/minor/major stay available as an explicit override.
ARGS="--ci"
if [ "${{ inputs.release-type }}" != "auto" ]; then
ARGS="${{ inputs.release-type }} $ARGS"
fi
if [ "${{ inputs.prerelease }}" != "none" ]; then
ARGS="$ARGS --preRelease=${{ inputs.prerelease }}"
fi
Expand Down
16 changes: 15 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Releases are cut from `main` via a GitHub Actions workflow. Only maintainers wit
1. Go to **Actions** → **Publish** in the repository.
2. Click **Run workflow**.
3. Choose inputs:
- **Release type**: `patch`, `minor`, or `major` (semver bump).
- **Release type**: `auto` (default) derives the semver bump from the conventional commits since the last tag. Pick `patch`, `minor`, or `major` only to force a specific bump.
- **Prerelease channel**:
- `none` — stable release (publishes to npm with tag `latest`).
- `alpha`, `beta`, or `rc` — prerelease (publishes with matching npm tag).
Expand All @@ -24,6 +24,20 @@ The workflow:
- Publishes the updated packages to npm with the appropriate dist-tag.
- Verifies the published dist-tags.

## Automatic version selection (`auto`)

With `release-type: auto` you don't pick the bump — `@release-it/conventional-changelog`
computes it from the commit types since the last `vX.Y.Z` tag:

- any `BREAKING CHANGE` / `!` → **major**
- any `feat` → **minor**
- otherwise (`fix`, `perf`, …) → **patch**

**Breaking changes must be marked in the commit title.** Merges are squashed, so the
PR title becomes the only commit message and the PR body (and any `BREAKING CHANGE:`
footer) is dropped. A breaking change therefore has to use the `!` form in the PR
title — `feat(x)!: …` or `fix(x)!: …` — or `auto` will under-bump it to a minor/patch.

## Release Cycles

Typical paths through the workflow, assuming the repo is currently at `2.0.0-alpha.33`.
Expand Down
Loading