Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: tox

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/version-check-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Verify Package Version

on:
release:
types: [created]

jobs:
verify-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install toml package
run: pip install toml

- name: Check version matches
run: |
import toml
import os
import sys

# Read pyproject.toml
with open('pyproject.toml', 'r') as f:
pyproject = toml.load(f)

# Get version from pyproject.toml
project_version = pyproject['project']['version']

# Get release tag (strip 'v' prefix if present)
github_ref = os.environ['GITHUB_REF']
tag_version = github_ref.split('/')[-1]
if tag_version.startswith('v'):
tag_version = tag_version[1:]

print(f"pyproject.toml version: {project_version}")
print(f"Release tag version: {tag_version}")

# Compare versions
if project_version != tag_version:
print("Version mismatch!")
print(f"pyproject.toml version ({project_version}) does not match")
print(f"release tag version ({tag_version})")
sys.exit(1)

print("Versions match!")
shell: python
Loading