Skip to content

Commit 5b2b6ec

Browse files
authored
Merge pull request #95 from DataFog/hotfix/readme-fix
Hotfix/readme fix
2 parents 22cbac6 + 9810c25 commit 5b2b6ec

File tree

3 files changed

+280
-493
lines changed

3 files changed

+280
-493
lines changed

.github/workflows/beta-release.yml

Lines changed: 23 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Beta Release (Thursday)
22

33
on:
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 "
10999
version = '$CURRENT_VERSION'
110100
parts = 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 }}"

.github/workflows/nightly-release.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ jobs:
3232
- name: Check for changes since last alpha release
3333
id: changes
3434
run: |
35-
# Get last alpha release tag
3635
LAST_ALPHA=$(git tag -l "*alpha*" --sort=-version:refname | head -n1)
37-
36+
3837
if [ -z "$LAST_ALPHA" ]; then
3938
echo "No previous alpha release found, checking last 24 hours"
4039
SINCE="24 hours ago"
@@ -43,11 +42,11 @@ jobs:
4342
echo "Last alpha release: $LAST_ALPHA"
4443
COMMIT_COUNT=$(git rev-list --count ${LAST_ALPHA}..dev)
4544
fi
46-
45+
4746
echo "Commits since last alpha: $COMMIT_COUNT"
4847
echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT
49-
50-
if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build }}" = "true" ]; then
48+
49+
if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build == 'true' }}" = "true" ]; then
5150
echo "has_changes=true" >> $GITHUB_OUTPUT
5251
echo "✅ Changes detected, proceeding with nightly build"
5352
else
@@ -87,20 +86,18 @@ jobs:
8786
- name: Generate alpha version
8887
id: version
8988
run: |
90-
# Get current version
89+
set -e
90+
9191
CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
9292
echo "Current version: $CURRENT_VERSION"
93-
94-
# Generate alpha version with timestamp
93+
9594
DATE_STAMP=$(date +"%Y%m%d")
9695
TIME_STAMP=$(date +"%H%M")
9796
COMMIT_SHORT=$(git rev-parse --short HEAD)
98-
99-
# If current version already has alpha, increment it
97+
10098
if [[ $CURRENT_VERSION == *"alpha"* ]]; then
10199
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
102100
else
103-
# Bump minor version for alpha (4.1.1 -> 4.2.0)
104101
BASE_VERSION=$(python3 -c "
105102
version = '$CURRENT_VERSION'
106103
parts = version.split('.')
@@ -109,12 +106,11 @@ parts[2] = '0'
109106
print('.'.join(parts))
110107
")
111108
fi
112-
109+
113110
ALPHA_VERSION="${BASE_VERSION}a${DATE_STAMP}.${TIME_STAMP}.${COMMIT_SHORT}"
114111
echo "Alpha version: $ALPHA_VERSION"
115112
echo "alpha_version=$ALPHA_VERSION" >> $GITHUB_OUTPUT
116-
117-
# Update version in files
113+
118114
sed -i "s/__version__ = \".*\"/__version__ = \"$ALPHA_VERSION\"/" datafog/__about__.py
119115
sed -i "s/version=\".*\"/version=\"$ALPHA_VERSION\"/" setup.py
120116

@@ -125,23 +121,19 @@ print('.'.join(parts))
125121
- name: Build package
126122
run: |
127123
python -m build
128-
129-
# Verify wheel size
130124
python scripts/check_wheel_size.py
131125
132126
- name: Create alpha release
133127
env:
134128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135129
run: |
136130
ALPHA_VERSION="${{ steps.version.outputs.alpha_version }}"
137-
138-
# Create and push tag
131+
139132
git add datafog/__about__.py setup.py
140133
git commit -m "chore: bump version to $ALPHA_VERSION for nightly release"
141134
git tag -a "v$ALPHA_VERSION" -m "Alpha release $ALPHA_VERSION"
142135
git push origin "v$ALPHA_VERSION"
143-
144-
# Create GitHub release
136+
145137
gh release create "v$ALPHA_VERSION" \
146138
--title "🌙 Nightly Alpha $ALPHA_VERSION" \
147139
--notes-file ALPHA_CHANGELOG.md \
@@ -171,10 +163,9 @@ print('.'.join(parts))
171163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172164
run: |
173165
echo "🧹 Cleaning up old alpha releases (keep last 7)..."
174-
175-
# Get all alpha releases, sorted by creation date
166+
176167
ALPHA_RELEASES=$(gh release list --limit 50 | grep alpha | tail -n +8 | cut -f3)
177-
168+
178169
for release in $ALPHA_RELEASES; do
179170
echo "Deleting old alpha release: $release"
180171
gh release delete "$release" --yes || true
@@ -191,4 +182,4 @@ print('.'.join(parts))
191182
echo "🌙 Nightly alpha release completed!"
192183
echo "📦 New alpha version available for testing"
193184
echo "💡 Install with: pip install datafog==${{ needs.nightly-release.outputs.alpha_version }}"
194-
echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"
185+
echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"

0 commit comments

Comments
 (0)