From 0bcd3888349634d83d635d317e3362b61e0538c5 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Wed, 23 Jul 2025 08:35:21 +0200 Subject: [PATCH] Added a pypi publish job to Github Actions --- .github/workflows/build.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ae0b2bd..be782cd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,3 +31,29 @@ jobs: with: name: dist-${{ matrix.python-version }} path: dist/ + + pypi-publish: + name: upload release to PyPI + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: test + # Specifying a GitHub environment is optional, but strongly encouraged + environment: + name: pypi + url: https://pypi.org/p/discid + permissions: + # IMPORTANT: this permission is mandatory for Trusted Publishing + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: 3.9 + cache: 'pip' + - name: Install dependencies + run: pip install build + - name: Build + run: python -m build --sdist . + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1