Skip to content

Commit a036f02

Browse files
sidmohan0claude
andcommitted
fix(ci): improve beta versioning logic and use GH_PAT token
Improvements to beta-release workflow: 1. Fixed version logic: Create beta of current version (4.2.0b1) instead of auto-incrementing minor version (4.3.0b1) for unreleased versions 2. Updated token usage: Use GH_PAT instead of GITHUB_TOKEN to resolve permission issues with git operations 3. Better versioning strategy: - 4.2.0 (unreleased) → 4.2.0b1 (current approach) - 4.2.0b1 → 4.2.0b2 (future increments) - Only increment minor version after official release 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9dc97ac commit a036f02

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/beta-release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
with:
6363
fetch-depth: 0
6464
ref: dev
65-
token: ${{ secrets.GITHUB_TOKEN }}
65+
token: ${{ secrets.GH_PAT }}
6666

6767
- name: Set up Python
6868
uses: actions/setup-python@v5
@@ -90,15 +90,18 @@ jobs:
9090
echo "Current version: $CURRENT_VERSION"
9191
9292
if [[ $CURRENT_VERSION == *"b"* ]]; then
93+
# Already a beta, increment beta number
9394
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'b' -f1)
9495
BETA_NUM=$(echo $CURRENT_VERSION | cut -d'b' -f2)
9596
BETA_VERSION="${BASE_VERSION}b$((BETA_NUM + 1))"
9697
elif [[ $CURRENT_VERSION == *"a"* ]]; then
98+
# Alpha version, convert to beta
9799
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
98100
BETA_VERSION="${BASE_VERSION}b1"
99101
else
100-
BASE_VERSION=$(python3 -c "import sys; version='$CURRENT_VERSION'; parts=version.split('.'); parts[1]=str(int(parts[1])+1); parts[2]='0'; print('.'.join(parts))")
101-
BETA_VERSION="${BASE_VERSION}b1"
102+
# Stable version - create beta of current version for unreleased features
103+
# Don't auto-increment minor version; use current version for beta testing
104+
BETA_VERSION="${CURRENT_VERSION}b1"
102105
fi
103106
104107
echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
@@ -137,7 +140,7 @@ jobs:
137140
138141
- name: Create GitHub release
139142
env:
140-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
141144
run: |
142145
BETA_VERSION="${{ steps.version.outputs.beta_version }}"
143146
git add datafog/__about__.py setup.py
@@ -169,7 +172,7 @@ jobs:
169172
170173
- name: Cleanup old betas
171174
env:
172-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
173176
run: |
174177
BETA_RELEASES=$(gh release list --limit 30 | grep b | tail -n +6 | cut -f3)
175178

0 commit comments

Comments
 (0)