Skip to content

feat: drop Python 3.9, bump minimum to 3.10 (#121) #55

feat: drop Python 3.9, bump minimum to 3.10 (#121)

feat: drop Python 3.9, bump minimum to 3.10 (#121) #55

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
env:
DO_NOT_TRACK: '1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update version in source
run: |
VERSION=${{ steps.version.outputs.VERSION }}
sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml
sed -i "s/^__version__ = .*/__version__ = \"${VERSION}\"/" axonflow/__init__.py
echo "Updated version to ${VERSION}"
grep version pyproject.toml | head -1
grep __version__ axonflow/__init__.py
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: pip install -e ".[dev,all]"
- name: Run tests
run: pytest
- name: Install build tools
run: pip install build
- name: Build package
run: python -m build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish-pypi:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
create-release:
needs: publish-pypi
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
name: Release ${{ github.ref_name }}
body: |
## AxonFlow Python SDK ${{ github.ref_name }}
### Installation
```bash
pip install axonflow
```
### Changes
See [CHANGELOG.md](https://github.com/getaxonflow/axonflow-sdk-python/blob/main/CHANGELOG.md) for full release details.
generate_release_notes: false
verify-publish:
needs: publish-pypi
runs-on: ubuntu-latest
steps:
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Wait for PyPI propagation
run: sleep 30
- name: Verify package on PyPI
run: |
VERSION=${{ steps.version.outputs.VERSION }}
for i in 1 2 3 4 5; do
echo "Attempt $i: Checking PyPI for axonflow==${VERSION}..."
if pip install --dry-run axonflow==${VERSION} 2>&1 | grep -q "Would install"; then
echo "SUCCESS: axonflow ${VERSION} is available on PyPI"
exit 0
fi
echo "Not yet available, waiting 30 seconds..."
sleep 30
done
echo "FAILURE: axonflow ${VERSION} not found on PyPI after 5 attempts"
exit 1