Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@ on:
types: [published]

jobs:
check-version:
name: Verify version matches tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Extract and compare versions
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
TOML_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")

if [ "$TAG_VERSION" != "$TOML_VERSION" ]; then
echo "Version mismatch: tag is v$TAG_VERSION, pyproject.toml is $TOML_VERSION"
exit 1
fi
echo "Versions match: $TOML_VERSION"

Comment on lines +8 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to test this? Also, if this fails, will we be able to re-run the failed action?

pypi-publish:
name: Publish to PyPI
needs: check-version
environment: release
runs-on: ubuntu-latest
permissions:
Expand Down
Loading