Skip to content

ci: Add version consistency check before PyPI publish#601

Open
PierreQuinton wants to merge 1 commit intomainfrom
ci/add-version-consistency-check
Open

ci: Add version consistency check before PyPI publish#601
PierreQuinton wants to merge 1 commit intomainfrom
ci/add-version-consistency-check

Conversation

@PierreQuinton
Copy link
Contributor

No description provided.

@PierreQuinton PierreQuinton added the cc: ci Conventional commit type for changes to the CI (Github workflows and actions). label Mar 2, 2026
@github-actions github-actions bot changed the title ci: add version consistency check before PyPI publish ci: Add version consistency check before PyPI publish Mar 2, 2026
Comment on lines +8 to +25
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"

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: ci Conventional commit type for changes to the CI (Github workflows and actions).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants