From 48bd3051ec00ea4793ee51ad9664734c16af5f59 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Wed, 1 Jul 2026 12:37:19 +0200 Subject: [PATCH] ci: apply SemVer version bump on macOS and Windows too (#9649) The previous fix only updated the Linux block because its old_string matched a longer comment that the macOS/Windows blocks never had, so those two jobs kept the original PEP 440 `.dev` syntax without the patch bump. Result: latest CI on `dev` (run 28509950366) still failed with `unexpected character '.' after patch version number` on both macOS and Windows, showing `version = "0.7.2.dev55"`. Bring both blocks in line with Linux: SemVer `-dev` suffix and the patch-component bump. Same awk logic on all three, so maturin sees a Cargo-valid version on every runner. Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/edge-py-release.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/edge-py-release.yml b/.github/workflows/edge-py-release.yml index 14e8363b4b..fcfda81363 100644 --- a/.github/workflows/edge-py-release.yml +++ b/.github/workflows/edge-py-release.yml @@ -123,12 +123,21 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set pre-release version + # See the identical step on the Linux job for the rationale (SemVer + # `-dev` + patch bump so maturin emits PEP 440 `X.Y.(Z+1).dev`). if: github.event_name == 'push' shell: bash working-directory: lib/edge/python run: | awk -v run="${GITHUB_RUN_NUMBER}" ' - !patched && /^version = "/ { sub(/"$/, ".dev" run "\""); patched = 1 } + !patched && /^version = "/ { + split($0, quoted, "\"") + split(quoted[2], parts, ".") + parts[3] = parts[3] + 1 + print "version = \"" parts[1] "." parts[2] "." parts[3] "-dev" run "\"" + patched = 1 + next + } { print } ' Cargo.toml > Cargo.toml.new mv Cargo.toml.new Cargo.toml @@ -176,12 +185,21 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set pre-release version + # See the identical step on the Linux job for the rationale (SemVer + # `-dev` + patch bump so maturin emits PEP 440 `X.Y.(Z+1).dev`). if: github.event_name == 'push' shell: bash working-directory: lib/edge/python run: | awk -v run="${GITHUB_RUN_NUMBER}" ' - !patched && /^version = "/ { sub(/"$/, ".dev" run "\""); patched = 1 } + !patched && /^version = "/ { + split($0, quoted, "\"") + split(quoted[2], parts, ".") + parts[3] = parts[3] + 1 + print "version = \"" parts[1] "." parts[2] "." parts[3] "-dev" run "\"" + patched = 1 + next + } { print } ' Cargo.toml > Cargo.toml.new mv Cargo.toml.new Cargo.toml