diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bc972dd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish to PyPI + +on: + pull_request: + types: + - closed + branches: + - main + +permissions: + contents: read + id-token: write + +jobs: + publish: + name: Publish to PyPI + if: | + github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'autorelease: tagged') + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/fixbikenet/ + + steps: + - uses: actions/checkout@v4 + + - name: Build package + run: | + python -m pip install build + python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1