Skip to content

Commit 35a52e6

Browse files
artizclaude
andcommitted
ci(release): any non-fix merge releases the 0.x "major"
Requiring conventional feat:/fix: prefixes silently stopped every release after v0.49.0 — the repo's de-facto commit style is bare area prefixes ("pdf: …", "wasm: …"), so bump_version.sh found nothing release-worthy in ~100 merged commits and every master merge ended in "nothing to release". Invert the rule: a range whose commits are all fix:/perf:/revert: cuts a patch; anything else bumps the middle number (0.49.0 -> 0.50.0). Docs/CI- only merges still release nothing — release.sh's source-change gate already requires a publishable crate's source in the diff. The automatic semver-major path ("type!:" / BREAKING CHANGE) is gone entirely: v1.0.0 is a hand-cut milestone via the force_version dispatch input, promised for the repo's 100th GitHub star. release.sh's comments and skip messages are re-worded to match, and CLAUDE.md documents the rule for future sessions (prefix bug fixes fix(scope):, don't worry about the rest). Merging this branch therefore auto-releases v0.50.0 with the whole backlog since v0.49.0. Signed-off-by: artiz <artem.kustikov@gmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT
1 parent e80df73 commit 35a52e6

3 files changed

Lines changed: 44 additions & 30 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ validated for byte-for-byte conformance against upstream Python docling.
88

99
- **Every commit must be signed off by the author.** End each commit message
1010
with `Signed-off-by: name <email>`.
11+
- **Releases are automatic on merge; only the `fix:` prefix matters.** CI
12+
(`scripts/ci/bump_version.sh`): a merge whose commits are all
13+
`fix:`/`perf:`/`revert:` cuts a patch (0.49.0 → 0.49.1); **any other
14+
commit** — whatever its prefix — bumps the 0.x "major" (0.49.0 → 0.50.0).
15+
So prefix bug fixes `fix(scope): …` and don't worry about the rest.
16+
Docs/CI-only merges still release nothing (release.sh only fires when a
17+
publishable crate's source changed). No automatic semver-major: v1.0.0 is
18+
cut by hand (`force_version` dispatch input) when the repo hits its 100-star
19+
milestone.
1120
- Claude Web: **Never open pull requests on `artiz/docling.rs`.** Push a `claude/<topic>`
1221
branch and hand back a compare link
1322
(`https://github.com/docling-project/docling.rs/compare/master...artiz:docling.rs:<branch>?expand=1`);

scripts/ci/bump_version.sh

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
#!/usr/bin/env bash
22
#
3-
# Decide the next workspace version from the conventional-commit messages since
4-
# the last release tag, and print it to stdout. Prints NOTHING (exit 0) when no
5-
# release-worthy commit is found, so the caller can skip the release.
3+
# Decide the next workspace version from the commit messages since the last
4+
# release tag, and print it to stdout. Prints NOTHING (exit 0) when the range
5+
# is empty, so the caller can skip the release.
66
#
7-
# <type>!: … or "BREAKING CHANGE" in the body -> major
8-
# feat: … -> minor
9-
# fix:/perf:/revert: … -> patch
10-
# docs/chore/ci/refactor/test/style/build/… -> no release
7+
# only fix:/perf:/revert: commits in the range -> patch
8+
# anything else -> minor (the 0.x "major")
9+
#
10+
# Releases deliberately do NOT depend on conventional-commit prefixes: the
11+
# repo's de-facto style is bare area prefixes ("pdf: …", "wasm: …"), and
12+
# requiring feat:/fix: silently stopped every release after v0.49.0. Any
13+
# non-fix merge now bumps 0.49 -> 0.50; a docs/CI-only merge still releases
14+
# nothing because release.sh's source-change gate sees no publishable crate
15+
# source in the diff.
16+
#
17+
# There is intentionally NO automatic semver-major: v1.0.0 is a milestone the
18+
# maintainer cuts by hand (FORCE_VERSION=1.0.0 via the CI dispatch input) —
19+
# "когда 100 звёзд дадут". Until then everything stays 0.x.
1120
#
1221
# Pure: reads git history + the root Cargo.toml; writes nothing.
1322
# Usage: scripts/ci/bump_version.sh
@@ -23,27 +32,20 @@ else
2332
range="HEAD" # no release tag yet: consider the whole history
2433
fi
2534

26-
# Subject + body of every non-merge commit in range.
27-
log="$(git log "$range" --no-merges --format='%s%n%b')"
35+
# Subjects decide the bump.
36+
subjects="$(git log "$range" --no-merges --format='%s')"
2837

2938
bump=""
30-
if grep -qE '^[a-z]+(\([^)]*\))?!:' <<<"$log" || grep -q 'BREAKING CHANGE' <<<"$log"; then
31-
bump="major"
32-
elif grep -qE '^feat(\([^)]*\))?:' <<<"$log"; then
39+
if grep -vE '^(fix|perf|revert)(\([^)]*\))?:' <<<"$subjects" | grep -q '[^[:space:]]'; then
3340
bump="minor"
34-
elif grep -qE '^(fix|perf|revert)(\([^)]*\))?:' <<<"$log"; then
41+
elif grep -q '[^[:space:]]' <<<"$subjects"; then
3542
bump="patch"
3643
fi
3744

3845
[[ -z "$bump" ]] && exit 0
3946

4047
IFS=. read -r major minor patch <<<"$current"
4148
case "$bump" in
42-
major)
43-
major=$((major + 1))
44-
minor=0
45-
patch=0
46-
;;
4749
minor)
4850
minor=$((minor + 1))
4951
patch=0

scripts/ci/release.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env bash
22
#
33
# Master-only release step (run by .github/workflows/ci.yml after the lint/test
4-
# gates pass). Computes the next version from conventional commits; if there is
5-
# one, it bumps the workspace version, commits + tags it, pushes to master,
6-
# publishes the changed crates, and assembles the GitHub Release notes (a commit
7-
# list since the previous tag) for the workflow to publish. A clean no-op when no
8-
# release-worthy commit landed since the last tag.
4+
# gates pass). Computes the next version from the commits since the last tag
5+
# (scripts/ci/bump_version.sh: fix:/perf:/revert:-only range -> patch, anything
6+
# else -> the 0.x "major"; no automatic 1.0.0); if there is one, it bumps the
7+
# workspace version, commits + tags it, pushes to master, publishes the changed
8+
# crates, and assembles the GitHub Release notes (a commit list since the
9+
# previous tag) for the workflow to publish. A clean no-op when nothing landed
10+
# since the last tag.
911
#
1012
# The release commit is pushed with RELEASE_PAT (an admin token, so it satisfies
1113
# the master branch ruleset) and carries `[skip ci]`, so it does not re-trigger CI.
@@ -20,16 +22,17 @@ cd "$(dirname "$0")/../.."
2022

2123
new="${FORCE_VERSION:-$(scripts/ci/bump_version.sh)}"
2224
if [[ -z "$new" ]]; then
23-
echo "No release-worthy commits since the last tag — nothing to release."
25+
echo "No commits since the last tag — nothing to release."
2426
exit 0
2527
fi
2628
[[ -n "${FORCE_VERSION:-}" ]] && echo ">> forced release of v$new"
2729

28-
# A release-worthy *message* is not enough: only cut a new crates.io version when
29-
# a *publishable* crate's actual source changed since the last tag. This stops a
30-
# docs / CI / Python-binding-only change (e.g. `feat(docs): …`, `feat(docling-py): …`)
31-
# from minting and publishing a new version of every crate with no code change.
32-
# FORCE_VERSION bypasses the gate (a deliberate manual (re)publish).
30+
# Commits alone are not enough: only cut a new crates.io version when a
31+
# *publishable* crate's actual source changed since the last tag. This is what
32+
# stops a docs / CI / demo / Python-binding-only merge (now that every non-fix
33+
# commit is release-worthy) from minting and publishing a new version of every
34+
# crate with no code change. FORCE_VERSION bypasses the gate (a deliberate
35+
# manual (re)publish).
3336
if [[ -z "${FORCE_VERSION:-}" ]]; then
3437
gate_prev_tag="$(git tag --list 'v*' --sort=-version:refname | head -n1)"
3538
gate_range="${gate_prev_tag:+$gate_prev_tag..}HEAD"
@@ -42,7 +45,7 @@ if [[ -z "${FORCE_VERSION:-}" ]]; then
4245
gate_paths+=("crates/$c/src" "crates/$c/Cargo.toml" "crates/$c/build.rs")
4346
done
4447
if [[ -z "$(git diff --name-only "$gate_range" -- "${gate_paths[@]}")" ]]; then
45-
echo "Release-worthy commit found, but no publishable crate source changed" \
48+
echo "Commits since the last tag, but no publishable crate source changed" \
4649
"since ${gate_prev_tag:-the start of history} — skipping release."
4750
exit 0
4851
fi

0 commit comments

Comments
 (0)