From 7abc2d3656d3385956d98eb4eb94748db35a36c0 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Wed, 12 Aug 2026 13:41:05 +0200 Subject: [PATCH] chore(release): bump pixi.toml version alongside CMake/CITATION The release script bumped CMakeLists.txt and CITATION.cff but left the [package] version in pixi.toml untouched, so it drifted from the tag (it sat at 0.2.0 through the 0.3.0 and 0.4.0 releases). Bump it in the same release commit, keeping the source dependency and the conda recipe in lockstep with the tag. The substitution is anchored at column 0 so it only matches the top-level version key, and is verified like the CMake bump. The block is guarded on the presence of that key so the same snippet is a clean no-op in sibling repos whose pixi.toml has no [package] section. Assisted-by: claude-code:claude-opus-4-8[1m] --- scripts/release.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 6984c1c..0282b21 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -16,9 +16,10 @@ Usage: scripts/release.sh The script must be run from a clean working tree. It will: 1. bump the VERSION line in CMakeLists.txt 2. bump version and date-released in CITATION.cff (if present) - 3. regenerate CHANGELOG.md with `git cliff --tag v` - 4. create commit `chore(release): v` - 5. create annotated tag `v` + 3. bump the [package] version in pixi.toml (if present) + 4. regenerate CHANGELOG.md with `git cliff --tag v` + 5. create commit `chore(release): v` + 6. create annotated tag `v` Pushing is left to the operator: git push origin && git push origin v @@ -93,12 +94,31 @@ if [[ -f "${CITATION_FILE}" ]]; then sed -i -E "s/^date-released: .*/date-released: \"$(date -u +%Y-%m-%d)\"/" "${CITATION_FILE}" fi +# Bump the [package] version in pixi.toml so the source dependency and the +# conda recipe stay in lockstep with the tag. Guarding on a top-level version +# key makes this a clean no-op where pixi.toml has no [package] section. +# Anchored at column 0, it only matches the top-level `version = "X.Y.Z"` key, +# not the inline `version =` fields of [package.build]/host-dependency tables. +PIXI_FILE="pixi.toml" +if [[ -f "${PIXI_FILE}" ]] && grep -qE '^version = "[0-9]+\.[0-9]+\.[0-9]+"' "${PIXI_FILE}"; then + sed -i -E "s/^version = \"[0-9]+\.[0-9]+\.[0-9]+\"/version = \"${VERSION}\"/" "${PIXI_FILE}" + if ! grep -qE "^version = \"${VERSION//./\\.}\"$" "${PIXI_FILE}"; then + echo "error: failed to update version in ${PIXI_FILE}" >&2 + git checkout -- "${CMAKE_FILE}" "${PIXI_FILE}" + [[ -f "${CITATION_FILE}" ]] && git checkout -- "${CITATION_FILE}" + exit 70 + fi +fi + git cliff --tag "${TAG}" -o CHANGELOG.md git add "${CMAKE_FILE}" CHANGELOG.md if [[ -f "${CITATION_FILE}" ]]; then git add "${CITATION_FILE}" fi +if [[ -f "${PIXI_FILE}" ]] && grep -qE "^version = \"${VERSION//./\\.}\"$" "${PIXI_FILE}"; then + git add "${PIXI_FILE}" +fi git commit -m "chore(release): ${TAG}" git tag -a "${TAG}" -m "Release ${TAG}"