No need for an xml report #16
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: release | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| release-test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Build package | |
| run: uv build | |
| - name: Set up a fresh environment and run tests | |
| run: | | |
| uv venv | |
| uv pip install dist/*.tar.gz | |
| uv pip install dist/*.whl | |
| uv pip install -e '.[test,estimate-area]' | |
| uv run pytest | |
| release: | |
| runs-on: ubuntu-22.04 | |
| needs: release-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Compare tags | |
| run: | | |
| PKG_VERSION=$(uv run python -c "import pathlib, tomllib; data = tomllib.loads(pathlib.Path('pyproject.toml').read_text()); print(data['project']['version'])") | |
| echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" | |
| [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] | |
| - name: Build package | |
| run: uv build | |
| - name: Install Twine | |
| run: | | |
| uv venv | |
| uv pip install twine | |
| - name: Validate deployment | |
| run: uv run twine check dist/* | |
| - name: Run deployment | |
| run: uv run twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} |