diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0e79654 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ + +name: Publish to PyPI +on: + release: + types: [published] +permissions: + contents: read +jobs: + deploy: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + - name: Build package + run: python -m build + - name: Publish package to PyPI + run: python -m twine upload dist/* --verbose