Skip to content

Commit a5f1002

Browse files
aksOpsclaude
andcommitted
Use PEP 440 format for beta tags (v0.0.1b0 instead of v0.0.1-beta.0)
Unified tag and version format to PEP 440 style for consistency. Tags are now v0.0.1b0, v0.0.1b1, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 276ff5e commit a5f1002

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

.github/workflows/beta.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,26 @@ jobs:
3434
id: version
3535
run: |
3636
# Derive base version from latest stable release tag (e.g. v0.0.1 -> 0.0.1)
37-
STABLE_TAG=$(git tag -l "v[0-9]*.[0-9]*.[0-9]*" --sort=-v:refname | grep -v beta | head -n1)
37+
STABLE_TAG=$(git tag -l "v[0-9]*.[0-9]*.[0-9]*" --sort=-v:refname | grep -vE 'b[0-9]+$' | head -n1)
3838
if [ -n "$STABLE_TAG" ]; then
3939
BASE="${STABLE_TAG#v}"
4040
else
4141
BASE=$(python3 -c "import tomli; print(tomli.load(open('pyproject.toml','rb'))['project']['version'])")
4242
fi
43-
# Find latest beta tag number and increment by 1 (starts at 0)
44-
LATEST=$(git tag -l "v${BASE}-beta.*" --sort=-v:refname | head -n1)
43+
# Find latest beta tag number (PEP 440: v0.0.1b0, v0.0.1b1, ...)
44+
LATEST=$(git tag -l "v${BASE}b*" --sort=-v:refname | head -n1)
4545
if [ -n "$LATEST" ]; then
46-
LAST_NUM=$(echo "$LATEST" | sed "s/v${BASE}-beta\.//")
46+
LAST_NUM=$(echo "$LATEST" | sed "s/v${BASE}b//")
4747
BETA_NUM=$((LAST_NUM + 1))
4848
else
4949
BETA_NUM=0
5050
fi
51-
# PEP 440 beta: 0.1.0b0, 0.1.0b1, ...
5251
PEP_VERSION="${BASE}b${BETA_NUM}"
53-
# Display: 0.1.0-beta.0, 0.1.0-beta.1, ...
54-
DISPLAY_VERSION="${BASE}-beta.${BETA_NUM}"
5552
SHORT_SHA=$(git rev-parse --short HEAD)
5653
echo "version=$PEP_VERSION" >> "$GITHUB_OUTPUT"
57-
echo "display=$DISPLAY_VERSION" >> "$GITHUB_OUTPUT"
58-
echo "tag=v${DISPLAY_VERSION}" >> "$GITHUB_OUTPUT"
54+
echo "tag=v${PEP_VERSION}" >> "$GITHUB_OUTPUT"
5955
echo "sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
60-
echo "Beta version: $DISPLAY_VERSION ($PEP_VERSION) @ ${SHORT_SHA}"
56+
echo "Beta version: v${PEP_VERSION} @ ${SHORT_SHA}"
6157
6258
- name: Patch version in pyproject.toml
6359
env:
@@ -93,13 +89,12 @@ jobs:
9389
- name: Create beta release with wheel
9490
env:
9591
BETA_TAG: ${{ steps.version.outputs.tag }}
96-
BETA_DISPLAY: ${{ steps.version.outputs.display }}
9792
BETA_PEP: ${{ steps.version.outputs.version }}
9893
BETA_SHA: ${{ steps.version.outputs.sha }}
9994
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10095
run: |
10196
gh release create "$BETA_TAG" dist/* \
102-
--title "$BETA_DISPLAY ($BETA_SHA)" \
97+
--title "${BETA_PEP} (${BETA_SHA})" \
10398
--notes "Auto-generated beta build from commit $BETA_SHA.
10499
105100
**Install:**

0 commit comments

Comments
 (0)