Skip to content

v0.0.16

v0.0.16 #13

Workflow file for this run

name: 'publish'
on:
release:
types:
- 'released'
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: false
jobs:
build-dist:
permissions:
contents: 'read'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v5'
- uses: 'astral-sh/setup-uv@v6'
- name: 'validate release tag matches pyproject version'
run: |
RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
TOML_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$RELEASE_VERSION" != "$TOML_VERSION" ]; then
echo "Error: Release version ($RELEASE_VERSION) does not match pyproject.toml version ($TOML_VERSION)"
exit 1
fi
echo "Version validation passed: $RELEASE_VERSION"
- run: 'uv build'
- uses: 'actions/upload-artifact@v4'
with:
name: 'dist'
path: 'dist/'
pypi-publish: # https://docs.pypi.org/trusted-publishers/using-a-publisher/
needs:
- 'build-dist'
environment: 'pypi' # follows guidance to allow for environment reviewer
permissions:
id-token: 'write'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/download-artifact@v5'
with:
name: 'dist'
path: 'dist/'
- uses: 'pypa/gh-action-pypi-publish@release/v1'