Repository navigation
bump: hilbertsfc (0.4.0 => 0.4.1) #13
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" | |
| on: | |
| push: | |
| tags: | |
| - test-* # TestPyPI tags | |
| - v* # Real PyPI tags | |
| jobs: | |
| publish: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| environment: ${{ startsWith(github.ref_name, 'v') && 'pypi' || 'testpypi' }} | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Build | |
| run: uv build | |
| - name: Smoke test (wheel) | |
| run: uv run --no-cache --isolated --no-project --with dist/*.whl --with pytest pytest -q | |
| - name: Smoke test (source distribution) | |
| run: uv run --no-cache --isolated --no-project --with dist/*.tar.gz --with pytest pytest -q | |
| - name: Publish | |
| run: | | |
| if [[ "${GITHUB_REF_NAME}" == test-* ]]; then | |
| uv publish --index testpypi | |
| else | |
| uv publish | |
| fi | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref_name, 'v') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |