name: Publish to PyPI on: push: tags: - "v*.*.*" workflow_dispatch: jobs: publish: runs-on: docker-amd64 container: image: python:3.12-bookworm steps: - name: Checkout repository run: | git clone --depth=1 --branch "${{ github.ref_name }}" \ "https://oauth2:${{ github.token }}@bitfreedom.net/code/${{ github.repository }}.git" \ . - name: Install build tools run: pip install build twine - name: Build package run: python -m build - name: Publish to PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: twine upload dist/*