diff --git a/.github/workflows/pub-pypi.yml b/.github/workflows/pub-pypi.yml index 8dc9359..329c844 100644 --- a/.github/workflows/pub-pypi.yml +++ b/.github/workflows/pub-pypi.yml @@ -1,13 +1,18 @@ name: Publish Python distributions to PyPI -on: push +on: [push] jobs: - build-n-publish: - if: github.repository_owner == 'robinzyb' - name: Build and publish Python distributions to PyPI + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/cp2kdata + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: + # retrieve your distributions here - uses: actions/checkout@master - name: Set up Python 3.9 @@ -30,9 +35,7 @@ jobs: --wheel --outdir dist/ . - - - name: Publish distribution to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Publish package distributions to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1