@@ -2,8 +2,7 @@ name: Beta Release (Thursday)
22
33on :
44 schedule :
5- # Thursday at 2 AM UTC - consolidate week's alpha changes into beta
6- - cron : ' 0 2 * * 4'
5+ - cron : ' 0 2 * * 4' # Thursday at 2 AM UTC
76 workflow_dispatch :
87 inputs :
98 dry_run :
@@ -33,28 +32,23 @@ jobs:
3332 - name : Check for changes since last beta release
3433 id : changes
3534 run : |
36- # Get last beta release tag
3735 LAST_BETA=$(git tag -l "*b*" --sort=-version:refname | head -n1)
38-
36+
3937 if [ -z "$LAST_BETA" ]; then
40- echo "No previous beta release found, checking last week"
41- SINCE="1 week ago"
42- COMMIT_COUNT=$(git rev-list --count --since="$SINCE" dev)
38+ echo "No previous beta release found"
39+ COMMIT_COUNT=$(git rev-list --count --since="1 week ago" dev)
4340 else
4441 echo "Last beta release: $LAST_BETA"
4542 COMMIT_COUNT=$(git rev-list --count ${LAST_BETA}..dev)
4643 fi
47-
48- echo "Commits since last beta: $COMMIT_COUNT"
44+
4945 echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT
5046 echo "last_beta=$LAST_BETA" >> $GITHUB_OUTPUT
51-
52- if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build }}" = "true" ]; then
47+
48+ if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build == 'true' }}" = "true" ]; then
5349 echo "has_changes=true" >> $GITHUB_OUTPUT
54- echo "✅ Changes detected, proceeding with beta build"
5550 else
5651 echo "has_changes=false" >> $GITHUB_OUTPUT
57- echo "ℹ️ No changes since last beta, skipping build"
5852 fi
5953
6054 beta-release :
@@ -89,22 +83,18 @@ jobs:
8983 - name : Generate beta version
9084 id : version
9185 run : |
92- # Get current version
86+ set -e
9387 CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
9488 echo "Current version: $CURRENT_VERSION"
95-
96- # Generate beta version
89+
9790 if [[ $CURRENT_VERSION == *"b"* ]]; then
98- # If already beta, increment beta number
9991 BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'b' -f1)
10092 BETA_NUM=$(echo $CURRENT_VERSION | cut -d'b' -f2)
10193 BETA_VERSION="${BASE_VERSION}b$((BETA_NUM + 1))"
10294 elif [[ $CURRENT_VERSION == *"a"* ]]; then
103- # If alpha, convert to beta
10495 BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
10596 BETA_VERSION="${BASE_VERSION}b1"
10697 else
107- # If stable, bump minor and add beta (4.1.1 -> 4.2.0)
10898 BASE_VERSION=$(python3 -c "
10999version = '$CURRENT_VERSION'
110100parts = version.split('.')
@@ -114,91 +104,66 @@ print('.'.join(parts))
114104" )
115105 BETA_VERSION=" ${BASE_VERSION}b1"
116106 fi
117-
118- echo "Beta version : $BETA_VERSION"
107+
119108 echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
120-
121- # Update version in files
122109 sed -i "s/__version__ = \".*\"/__version__ = \"$BETA_VERSION\"/" datafog/__about__.py
123110 sed -i "s/version=\".*\"/version=\"$BETA_VERSION\"/" setup.py
124111
125- - name : Generate changelog for beta
112+ - name : Generate changelog
126113 run : |
127114 python scripts/generate_changelog.py --beta --output BETA_CHANGELOG.md
128115
129- - name : Run comprehensive tests
116+ - name : Run tests
130117 run : |
131- echo "🧪 Running comprehensive test suite for beta release..."
132-
133- # Run core tests
134118 python -m pytest tests/ -v --tb=short
135-
136- # Run integration tests
137119 python -m pytest -m integration -v
138-
139- # Run benchmarks to ensure performance
140120 python -m pytest tests/benchmark_text_service.py -v
141-
142- echo "✅ All tests passed for beta release"
143121
144122 - name : Build package
145123 run : |
146124 python -m build
147-
148- # Verify wheel size
149125 python scripts/check_wheel_size.py
150-
151- echo "📦 Beta package built successfully"
152126
153- - name : Create beta release
127+ - name : Create GitHub release
154128 env :
155129 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156130 run : |
157131 BETA_VERSION="${{ steps.version.outputs.beta_version }}"
158-
159- # Create and push tag
160132 git add datafog/__about__.py setup.py
161133 git commit -m "chore: bump version to $BETA_VERSION for beta release"
162134 git tag -a "v$BETA_VERSION" -m "Beta release $BETA_VERSION"
163135 git push origin "v$BETA_VERSION"
164-
165- # Create GitHub release
136+
166137 gh release create "v$BETA_VERSION" \
167138 --title "🚧 Beta Release $BETA_VERSION" \
168139 --notes-file BETA_CHANGELOG.md \
169140 --prerelease \
170141 --target dev \
171142 dist/*
172143
173- - name : Publish to PyPI (Beta)
144+ - name : Publish to PyPI
174145 if : github.event.inputs.dry_run != 'true'
175146 env :
176147 TWINE_USERNAME : __token__
177148 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
178149 run : |
179- echo "🚀 Publishing beta release to PyPI..."
180150 python -m twine upload dist/* --verbose
181151
182152 - name : Dry run summary
183153 if : github.event.inputs.dry_run == 'true'
184154 run : |
185- echo "🏃♂️ DRY RUN COMPLETED "
155+ echo "🏃 DRY RUN COMPLETE "
186156 echo "Would have published: ${{ steps.version.outputs.beta_version }}"
187- echo "Package contents:"
188157 ls -la dist/
189- echo "Test results: All tests would be run"
190158
191- - name : Cleanup old beta releases
159+ - name : Cleanup old betas
192160 env :
193161 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
194162 run : |
195- echo "🧹 Cleaning up old beta releases (keep last 5)..."
196-
197- # Get all beta releases, sorted by creation date
198- BETA_RELEASES=$(gh release list --limit 30 | grep "🚧.*b[0-9]" | tail -n +6 | cut -f3)
199-
163+ BETA_RELEASES=$(gh release list --limit 30 | grep b | tail -n +6 | cut -f3)
164+
200165 for release in $BETA_RELEASES; do
201- echo "Deleting old beta release: $release"
166+ echo "Deleting $release"
202167 gh release delete "$release" --yes || true
203168 git push --delete origin "$release" || true
204169 done
@@ -210,35 +175,6 @@ print('.'.join(parts))
210175 steps :
211176 - name : Beta release notification
212177 run : |
213- echo "🚧 Thursday beta release completed!"
214- echo "📦 Beta version ready for final testing"
215- echo "💡 Install with: pip install datafog==${{ needs.beta-release.outputs.beta_version }}"
216- echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"
217- echo "🗓️ Stable release scheduled for Friday"
218- echo ""
219- echo "🧪 Beta Testing Checklist:"
220- echo " ✅ All automated tests passed"
221- echo " ⏳ Manual testing recommended"
222- echo " ⏳ Performance validation"
223- echo " ⏳ Integration testing"
224-
225- prepare-friday-release :
226- needs : [beta-release]
227- if : success()
228- runs-on : ubuntu-latest
229- steps :
230- - name : Prepare Friday stable release
231- run : |
232- echo "🎯 Preparing for Friday stable release..."
233- echo "Current beta: ${{ needs.beta-release.outputs.beta_version }}"
234-
235- # Extract base version for Friday
236- BETA_VERSION="${{ needs.beta-release.outputs.beta_version }}"
237- STABLE_VERSION=$(echo $BETA_VERSION | cut -d'b' -f1)
238-
239- echo "Planned stable version: $STABLE_VERSION"
240- echo "📋 Friday Release Checklist:"
241- echo " ⏳ Final beta testing"
242- echo " ⏳ Update CHANGELOG.md"
243- echo " ⏳ Run weekly release workflow"
244- echo " ⏳ Social media announcement"
178+ echo "🚧 Beta release completed!"
179+ echo "Install: pip install datafog==${{ needs.beta-release.outputs.beta_version }}"
180+ echo "Commits since last beta: ${{ needs.check-changes.outputs.commit_count }}"
0 commit comments