v0.3.0 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/upbeat/ | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Verify version matches tag | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PKG_VERSION=$(uv version --short) | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "ERROR: Tag version ($TAG_VERSION) ≠ package version ($PKG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: uv build --no-sources | |
| - name: Smoke test | |
| run: uv run --isolated --no-project --with dist/*.whl -- python -c "import upbeat; print(upbeat.__version__)" | |
| - name: Publish to PyPI | |
| run: uv publish |