Skip to content

Commit 7609e49

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 7609e49

File tree

3 files changed

+132
-11
lines changed

3 files changed

+132
-11
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

BETA_CHANGELOG.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Beta Release Notes
2+
3+
_Beta Release: 2025-05-30_
4+
5+
⚠️ **This is a beta release for testing purposes.**
6+
7+
## 🚀 New Features
8+
9+
- fix(ci): add diagnostics and plugin verification for benchmark tests
10+
- fix(ci): add diagnostics and plugin verification for benchmark tests
11+
- Merge pull request #104 from DataFog/feature/sample-notebooks
12+
- Merge branch 'dev' into feature/sample-notebooks
13+
- Fix segmentation fault in beta-release workflow and add sample notebook
14+
- Merge pull request #103 from DataFog/feature/sample-notebooks
15+
- Fix segmentation fault in beta-release workflow and add sample notebook
16+
- Merge pull request #102 from DataFog/feature/gliner-integration-v420
17+
- Merge branch 'dev' into feature/gliner-integration-v420
18+
- Merge branch 'feature/gliner-integration-v420' of github.com:DataFog/datafog-python into feature/gliner-integration-v420
19+
- Merge pull request #101 from DataFog/feature/gliner-integration-v420
20+
- Merge branch 'dev' into feature/gliner-integration-v420
21+
- Merge pull request #100 from DataFog/feature/gliner-integration-v420
22+
- docs: add release guidelines to Claude.md
23+
- feat(nlp): add GLiNER integration with smart cascading engine
24+
- fix(deps): add pydantic-settings to cli and all extras
25+
- Merge pull request #92 from DataFog/feature/automated-release-pipeline
26+
- feat(ci): configure release workflows for 4.2.0 minor version bump
27+
- feat(ci): add comprehensive alpha→beta→stable release cycle
28+
- feat(ci): add nightly alpha builds for Monday-Thursday
29+
- Merge pull request #91 from DataFog/feature/implement-weekly-release-plan
30+
- feat(release): implement weekly release plan infrastructure
31+
32+
## 🐛 Bug Fixes
33+
34+
- fix(ci): improve beta versioning logic and use GH_PAT token
35+
- fix(ci): replace invalid --benchmark-skip flag with simple performance test
36+
- Merge branch 'dev' into fix/performance-regression
37+
- Merge pull request #105 from DataFog/fix/performance-regression
38+
- fix(ci): reset benchmark baseline to resolve false regression alerts
39+
- fix(performance): eliminate memory debugging overhead from benchmarks
40+
- fix(performance): eliminate redundant regex calls in structured output mode
41+
- fix(performance): eliminate redundant regex calls in structured output mode
42+
- fix(ci): handle segfault gracefully while preserving test validation
43+
- fix(tests): make spaCy address detection test more robust
44+
- fix(ci): improve GLiNER validation to confirm PyTorch exclusion
45+
- fix(ci): exclude PyTorch dependencies entirely to prevent segfault
46+
- fix(ci): eliminate PyTorch segfaults and enhance README with GLiNER examples
47+
- fix(ci): workaround for PyTorch segfault in CI environments
48+
- fix(ci): split test execution to prevent memory segfault
49+
- fix(ci): reduce coverage reporting to prevent segmentation fault
50+
- fix(tests): resolve final GLiNER test failures
51+
- fix(tests): update GLiNER test mocking for proper import paths
52+
- fix(tests): resolve GLiNER dependency mocking for CI environments
53+
- Merge pull request #99 from DataFog/fix/github-actions-workflow-fixes
54+
- Merge branch 'dev' into fix/github-actions-workflow-fixes
55+
- fix(deps): move pydantic-settings to core dependencies
56+
- fix(ci): install all extras and configure pytest-asyncio in workflows
57+
- Merge pull request #98 from DataFog/fix/github-actions-workflow-fixes
58+
- fix(ci): resolve YAML syntax errors in GitHub Actions workflows
59+
- Merge pull request #96 from DataFog/codex/fix-failing-github-actions-in-workflows
60+
- fix release workflows
61+
- Merge pull request #95 from DataFog/hotfix/readme-fix
62+
- Merge branch 'dev' into hotfix/readme-fix
63+
- fix(ci): remove indentation from Python code in workflow commands
64+
- fix(text): resolve missing Span import for structured output
65+
- fix(ci): resolve YAML syntax issues in workflow files
66+
- fix(ci): resolve prettier pre-commit hook configuration
67+
- fix(ci): resolve YAML syntax issues in release workflows
68+
- fix(lint): resolve flake8 string formatting warnings
69+
- fix(ci): restore expected job names and consolidate workflows
70+
- fix(imports): resolve flake8 E402 import order issues
71+
72+
## 📚 Documentation
73+
74+
- docs: streamline Claude.md development guide for v4.2.0
75+
- fixed readme
76+
77+
## 🔧 Other Changes
78+
79+
- chore: set version to 4.2.0b1 for beta testing of unreleased 4.2.0
80+
- resolve: merge conflicts with enhanced segfault detection
81+
- release: prepare v4.2.0 with GLiNER integration
82+
- updated workflows
83+
- Merge pull request #94 from DataFog/hotfix/beta-workflow-yaml-syntax
84+
- Merge branch 'dev' into hotfix/beta-workflow-yaml-syntax
85+
- Merge pull request #93 from DataFog/hotfix/beta-workflow-yaml-syntax
86+
87+
## 📥 Installation
88+
89+
```bash
90+
# Core package (lightweight)
91+
pip install datafog
92+
93+
# With all features
94+
pip install datafog[all]
95+
```
96+
97+
## 📊 Metrics
98+
99+
- Package size: ~2MB (core)
100+
- Install time: ~10 seconds
101+
- Tests passing: ✅
102+
- Commits this week: 68

scripts/generate_changelog.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
"""Generate changelog for weekly releases."""
33

4+
import argparse
45
import re
56
import subprocess
67
from datetime import datetime
@@ -60,7 +61,7 @@ def categorize_commits(commits):
6061
return categories
6162

6263

63-
def generate_changelog():
64+
def generate_changelog(beta=False):
6465
"""Generate changelog content."""
6566
latest_tag = get_latest_tag()
6667
commits = get_commits_since_tag(latest_tag)
@@ -70,8 +71,13 @@ def generate_changelog():
7071

7172
categories = categorize_commits(commits)
7273

73-
changelog = "# What's New\n\n"
74-
changelog += f"*Released: {datetime.now().strftime('%Y-%m-%d')}*\n\n"
74+
if beta:
75+
changelog = "# Beta Release Notes\n\n"
76+
changelog += f"*Beta Release: {datetime.now().strftime('%Y-%m-%d')}*\n\n"
77+
changelog += "⚠️ **This is a beta release for testing purposes.**\n\n"
78+
else:
79+
changelog = "# What's New\n\n"
80+
changelog += f"*Released: {datetime.now().strftime('%Y-%m-%d')}*\n\n"
7581

7682
if categories["features"]:
7783
changelog += "## 🚀 New Features\n"
@@ -121,13 +127,23 @@ def generate_changelog():
121127

122128

123129
if __name__ == "__main__":
124-
changelog_content = generate_changelog()
130+
parser = argparse.ArgumentParser(description="Generate changelog for releases")
131+
parser.add_argument(
132+
"--beta", action="store_true", help="Generate beta release changelog"
133+
)
134+
parser.add_argument(
135+
"--output", help="Output file name", default="CHANGELOG_LATEST.md"
136+
)
137+
138+
args = parser.parse_args()
139+
140+
changelog_content = generate_changelog(beta=args.beta)
125141

126142
# Write to file for GitHub release
127-
with open("CHANGELOG_LATEST.md", "w") as f:
143+
with open(args.output, "w") as f:
128144
f.write(changelog_content)
129145

130-
print("✅ Changelog generated: CHANGELOG_LATEST.md")
146+
print(f"✅ Changelog generated: {args.output}")
131147
print("\nPreview:")
132148
print("=" * 50)
133149
print(changelog_content)

0 commit comments

Comments
 (0)