Skip to content

build(release): Let craft pick the version bump - #164

Merged
vaind merged 1 commit into
mainfrom
ivan/craft-auto-version
Oct 26, 2026
Merged

vaind merged 1 commit into
mainfrom
ivan/craft-auto-version

Conversation

@vaind

@vaind vaind commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The release workflow computes the next version with uv version --bump from a bump type picked by hand. A breaking PR (a type!: title, e.g. #162) only becomes a major release if the person running the release remembers to pick major.

Approach

  • Pass the workflow input straight to action-prepare-release, which hands it to craft prepare. The new default is auto: craft finds the highest bump among the PR titles since the last tag, using its built-in conventional-commit categories (type!: → major, feat: → minor, everything else → patch).
  • Keep minor/patch/major as manual overrides. Craft resolves those against the last tag too, so the uv calculation step is removed. uv is still installed because scripts/bump-version.sh writes the chosen version with it.

auto and bump types are supported from craft 2.14, below our minVersion of 2.21.1. auto fails the release with a clear message if there are no new commits, or if none of them has a conventional-commit title. Pick an explicit bump in that case.

This works on its own, but pairs with #163, which turns on the changelog these categories feed into.

Checked with actionlint. The real test is the next release run.

🤖 Generated with Claude Code

The workflow computed the next version with uv from a manually chosen
bump type, so a breaking PR (`type!:` title) only shipped as a major
release if whoever ran the release remembered to pick "major". Passing
"auto" to craft instead derives the bump from the conventional-commit
PR titles since the last tag. The explicit bump types stay available as
overrides, and craft resolves them against the last tag too, so the uv
calculation step is no longer needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vaind
vaind requested a review from a team as a code owner October 23, 2026 06:44
@vaind
vaind merged commit 2791fc3 into main Oct 26, 2026
14 checks passed
@vaind
vaind deleted the ivan/craft-auto-version branch October 26, 2026 07:14
vaind added a commit that referenced this pull request Oct 26, 2026
## Problem

Since #164, releases default to `version: auto`. Craft resolved it
correctly and prepared `release/2.0.0`. But the pinned
`getsentry/action-prepare-release` v1.6.6 titles the publish issue with
the raw input, so it requested `getsentry/scm-platform@auto`
(getsentry/publish#10017). The publish workflow takes the version from
that title, so approving the issue would run `craft publish auto`.

## Approach

Switch to the same action, which now lives in the craft repo
(`getsentry/craft`), pinned to 3.0.0. It titles the issue with the
version craft resolved (`RESOLVED_VERSION` in its `action.yml`). The
inputs we pass (`version`, `force`, `GITHUB_TOKEN`) are unchanged.
sentry-dotnet already uses this action.

None of 3.0.0's breaking changes apply here:
- **Changelog path without workspaces is rejected:** we don't set a
changelog path.
- **`prepare` fails when automatic bumping finds nothing:** our
`preReleaseCommand` does the bump, so craft's automatic bumping never
runs.
- **nuget workspaces:** not a target here.

Checked with actionlint. Before the next release run, retract
getsentry/publish#10017 and delete the `release/2.0.0` branch.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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