Skip to content

Workflow file for this run

name: Upload Python Package to PyPi
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.8.3
poetry config pypi-token.pypi ${{ secrets.PYPI_PUBLISH_TOKEN }}
- name: Extract version from tag
id: extract_version
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo ${TAG_NAME}
- name: Update version in pyproject.toml
run: |
sed -i "s/^version = .*/version = \"$TAG_NAME\"/" pyproject.toml
- name: Build package
run: poetry build
- name: Publish package
run: poetry publish