diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3765025 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: release + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.10" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build + + - name: Build package + run: python -m build --sdist --wheel + + - name: Publish to PyPI + if: github.event_name != 'pull_request' + uses: pypa/gh-action-pypi-publish@v1.13.0 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + skip_existing: true