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
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ jobs:
- name: Build the package
run: python -m build

- 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

- name: Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/version-check-on-release.yml

This file was deleted.

Loading