Skip to content

Hotfix/readme fix #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 23 additions & 87 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Beta Release (Thursday)

on:
schedule:
# Thursday at 2 AM UTC - consolidate week's alpha changes into beta
- cron: '0 2 * * 4'
- cron: '0 2 * * 4' # Thursday at 2 AM UTC
workflow_dispatch:
inputs:
dry_run:
Expand Down Expand Up @@ -33,28 +32,23 @@ jobs:
- name: Check for changes since last beta release
id: changes
run: |
# Get last beta release tag
LAST_BETA=$(git tag -l "*b*" --sort=-version:refname | head -n1)

if [ -z "$LAST_BETA" ]; then
echo "No previous beta release found, checking last week"
SINCE="1 week ago"
COMMIT_COUNT=$(git rev-list --count --since="$SINCE" dev)
echo "No previous beta release found"
COMMIT_COUNT=$(git rev-list --count --since="1 week ago" dev)
else
echo "Last beta release: $LAST_BETA"
COMMIT_COUNT=$(git rev-list --count ${LAST_BETA}..dev)
fi

echo "Commits since last beta: $COMMIT_COUNT"

echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT
echo "last_beta=$LAST_BETA" >> $GITHUB_OUTPUT
if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build }}" = "true" ]; then

if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build == 'true' }}" = "true" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "✅ Changes detected, proceeding with beta build"
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "ℹ️ No changes since last beta, skipping build"
fi

beta-release:
Expand Down Expand Up @@ -89,22 +83,18 @@ jobs:
- name: Generate beta version
id: version
run: |
# Get current version
set -e
CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
echo "Current version: $CURRENT_VERSION"

# Generate beta version

if [[ $CURRENT_VERSION == *"b"* ]]; then
# If already beta, increment beta number
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'b' -f1)
BETA_NUM=$(echo $CURRENT_VERSION | cut -d'b' -f2)
BETA_VERSION="${BASE_VERSION}b$((BETA_NUM + 1))"
elif [[ $CURRENT_VERSION == *"a"* ]]; then
# If alpha, convert to beta
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
BETA_VERSION="${BASE_VERSION}b1"
else
# If stable, bump minor and add beta (4.1.1 -> 4.2.0)
BASE_VERSION=$(python3 -c "
version = '$CURRENT_VERSION'
parts = version.split('.')
Expand All @@ -114,91 +104,66 @@ print('.'.join(parts))
")
BETA_VERSION="${BASE_VERSION}b1"
fi

echo "Beta version: $BETA_VERSION"

echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT

# Update version in files
sed -i "s/__version__ = \".*\"/__version__ = \"$BETA_VERSION\"/" datafog/__about__.py
sed -i "s/version=\".*\"/version=\"$BETA_VERSION\"/" setup.py

- name: Generate changelog for beta
- name: Generate changelog
run: |
python scripts/generate_changelog.py --beta --output BETA_CHANGELOG.md

- name: Run comprehensive tests
- name: Run tests
run: |
echo "🧪 Running comprehensive test suite for beta release..."

# Run core tests
python -m pytest tests/ -v --tb=short

# Run integration tests
python -m pytest -m integration -v

# Run benchmarks to ensure performance
python -m pytest tests/benchmark_text_service.py -v

echo "✅ All tests passed for beta release"

- name: Build package
run: |
python -m build

# Verify wheel size
python scripts/check_wheel_size.py

echo "📦 Beta package built successfully"

- name: Create beta release
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BETA_VERSION="${{ steps.version.outputs.beta_version }}"

# Create and push tag
git add datafog/__about__.py setup.py
git commit -m "chore: bump version to $BETA_VERSION for beta release"
git tag -a "v$BETA_VERSION" -m "Beta release $BETA_VERSION"
git push origin "v$BETA_VERSION"

# Create GitHub release

gh release create "v$BETA_VERSION" \
--title "🚧 Beta Release $BETA_VERSION" \
--notes-file BETA_CHANGELOG.md \
--prerelease \
--target dev \
dist/*

- name: Publish to PyPI (Beta)
- name: Publish to PyPI
if: github.event.inputs.dry_run != 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
echo "🚀 Publishing beta release to PyPI..."
python -m twine upload dist/* --verbose

- name: Dry run summary
if: github.event.inputs.dry_run == 'true'
run: |
echo "🏃‍♂️ DRY RUN COMPLETED"
echo "🏃 DRY RUN COMPLETE"
echo "Would have published: ${{ steps.version.outputs.beta_version }}"
echo "Package contents:"
ls -la dist/
echo "Test results: All tests would be run"

- name: Cleanup old beta releases
- name: Cleanup old betas
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🧹 Cleaning up old beta releases (keep last 5)..."

# Get all beta releases, sorted by creation date
BETA_RELEASES=$(gh release list --limit 30 | grep "🚧.*b[0-9]" | tail -n +6 | cut -f3)

BETA_RELEASES=$(gh release list --limit 30 | grep b | tail -n +6 | cut -f3)

for release in $BETA_RELEASES; do
echo "Deleting old beta release: $release"
echo "Deleting $release"
gh release delete "$release" --yes || true
git push --delete origin "$release" || true
done
Expand All @@ -210,35 +175,6 @@ print('.'.join(parts))
steps:
- name: Beta release notification
run: |
echo "🚧 Thursday beta release completed!"
echo "📦 Beta version ready for final testing"
echo "💡 Install with: pip install datafog==${{ needs.beta-release.outputs.beta_version }}"
echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"
echo "🗓️ Stable release scheduled for Friday"
echo ""
echo "🧪 Beta Testing Checklist:"
echo " ✅ All automated tests passed"
echo " ⏳ Manual testing recommended"
echo " ⏳ Performance validation"
echo " ⏳ Integration testing"

prepare-friday-release:
needs: [beta-release]
if: success()
runs-on: ubuntu-latest
steps:
- name: Prepare Friday stable release
run: |
echo "🎯 Preparing for Friday stable release..."
echo "Current beta: ${{ needs.beta-release.outputs.beta_version }}"

# Extract base version for Friday
BETA_VERSION="${{ needs.beta-release.outputs.beta_version }}"
STABLE_VERSION=$(echo $BETA_VERSION | cut -d'b' -f1)

echo "Planned stable version: $STABLE_VERSION"
echo "📋 Friday Release Checklist:"
echo " ⏳ Final beta testing"
echo " ⏳ Update CHANGELOG.md"
echo " ⏳ Run weekly release workflow"
echo " ⏳ Social media announcement"
echo "🚧 Beta release completed!"
echo "Install: pip install datafog==${{ needs.beta-release.outputs.beta_version }}"
echo "Commits since last beta: ${{ needs.check-changes.outputs.commit_count }}"
39 changes: 15 additions & 24 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ jobs:
- name: Check for changes since last alpha release
id: changes
run: |
# Get last alpha release tag
LAST_ALPHA=$(git tag -l "*alpha*" --sort=-version:refname | head -n1)

if [ -z "$LAST_ALPHA" ]; then
echo "No previous alpha release found, checking last 24 hours"
SINCE="24 hours ago"
Expand All @@ -43,11 +42,11 @@ jobs:
echo "Last alpha release: $LAST_ALPHA"
COMMIT_COUNT=$(git rev-list --count ${LAST_ALPHA}..dev)
fi

echo "Commits since last alpha: $COMMIT_COUNT"
echo "commit_count=$COMMIT_COUNT" >> $GITHUB_OUTPUT
if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build }}" = "true" ]; then

if [ "$COMMIT_COUNT" -gt 0 ] || [ "${{ github.event.inputs.force_build == 'true' }}" = "true" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "✅ Changes detected, proceeding with nightly build"
else
Expand Down Expand Up @@ -87,20 +86,18 @@ jobs:
- name: Generate alpha version
id: version
run: |
# Get current version
set -e

CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
echo "Current version: $CURRENT_VERSION"

# Generate alpha version with timestamp

DATE_STAMP=$(date +"%Y%m%d")
TIME_STAMP=$(date +"%H%M")
COMMIT_SHORT=$(git rev-parse --short HEAD)

# If current version already has alpha, increment it

if [[ $CURRENT_VERSION == *"alpha"* ]]; then
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
else
# Bump minor version for alpha (4.1.1 -> 4.2.0)
BASE_VERSION=$(python3 -c "
version = '$CURRENT_VERSION'
parts = version.split('.')
Expand All @@ -109,12 +106,11 @@ parts[2] = '0'
print('.'.join(parts))
")
fi

ALPHA_VERSION="${BASE_VERSION}a${DATE_STAMP}.${TIME_STAMP}.${COMMIT_SHORT}"
echo "Alpha version: $ALPHA_VERSION"
echo "alpha_version=$ALPHA_VERSION" >> $GITHUB_OUTPUT

# Update version in files

sed -i "s/__version__ = \".*\"/__version__ = \"$ALPHA_VERSION\"/" datafog/__about__.py
sed -i "s/version=\".*\"/version=\"$ALPHA_VERSION\"/" setup.py

Expand All @@ -125,23 +121,19 @@ print('.'.join(parts))
- name: Build package
run: |
python -m build

# Verify wheel size
python scripts/check_wheel_size.py

- name: Create alpha release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ALPHA_VERSION="${{ steps.version.outputs.alpha_version }}"

# Create and push tag

git add datafog/__about__.py setup.py
git commit -m "chore: bump version to $ALPHA_VERSION for nightly release"
git tag -a "v$ALPHA_VERSION" -m "Alpha release $ALPHA_VERSION"
git push origin "v$ALPHA_VERSION"

# Create GitHub release

gh release create "v$ALPHA_VERSION" \
--title "🌙 Nightly Alpha $ALPHA_VERSION" \
--notes-file ALPHA_CHANGELOG.md \
Expand Down Expand Up @@ -171,10 +163,9 @@ print('.'.join(parts))
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🧹 Cleaning up old alpha releases (keep last 7)..."

# Get all alpha releases, sorted by creation date

ALPHA_RELEASES=$(gh release list --limit 50 | grep alpha | tail -n +8 | cut -f3)

for release in $ALPHA_RELEASES; do
echo "Deleting old alpha release: $release"
gh release delete "$release" --yes || true
Expand All @@ -191,4 +182,4 @@ print('.'.join(parts))
echo "🌙 Nightly alpha release completed!"
echo "📦 New alpha version available for testing"
echo "💡 Install with: pip install datafog==${{ needs.nightly-release.outputs.alpha_version }}"
echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"
echo "📊 Commits included: ${{ needs.check-changes.outputs.commit_count }}"
Loading