Merge branch 'auto-build-multiscale-pyramid' #14
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: | |
| push: | |
| tags: ["v*"] | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/test.yml | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: pip install build twine | |
| - name: Verify version matches tag | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/v}" | |
| PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") | |
| if [ "$TAG" != "$PKG_VERSION" ]; then | |
| echo "ERROR: Tag v$TAG does not match pyproject.toml version $PKG_VERSION" | |
| exit 1 | |
| fi | |
| - name: Build sdist and wheel | |
| run: python -m build | |
| - name: Check distributions | |
| run: twine check dist/* | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |