Skip to content

chore: Prefix v2 in the endpoint methods. (#5) #12

chore: Prefix v2 in the endpoint methods. (#5)

chore: Prefix v2 in the endpoint methods. (#5) #12

Workflow file for this run

name: Publish Package
on:
push:
branches:
- main
permissions:
id-token: write
contents: write
jobs:
check-if-tag:
name: Check if Tag is Present
runs-on: ubuntu-22.04
outputs:
TAG_NOT_PRESENT: ${{ steps.get-tag.outputs.TAG_NOT_PRESENT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get the tag from Python and check if it's present
id: get-tag
run: |
pip install toml
VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
if git tag -l "v$VERSION" | grep -q .; then
echo "Tag v$VERSION is present"
echo "TAG_NOT_PRESENT=false" >> $GITHUB_OUTPUT
else
echo "Tag v$VERSION is not present"
echo "TAG_NOT_PRESENT=true" >> $GITHUB_OUTPUT
git tag "v$VERSION"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git push origin "v$VERSION"
fi
publish:
name: Publish Package to PyPI
runs-on: ubuntu-22.04
needs: check-if-tag
if: needs.check-if-tag.outputs.TAG_NOT_PRESENT == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- run: pip install build twine
- run: pip install -e ".[dev]"
- run: python -m build
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0