diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7cd5fe1..334fd37 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,9 +2,16 @@ name: CD on: push: tags: v* + jobs: - publish: + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/wxc + permissions: + id-token: write steps: - name: Checkout Source uses: actions/checkout@v3 @@ -17,8 +24,6 @@ jobs: - name: Build distributions shell: bash -l {0} run: python -m build - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.7 - with: - user: __token__ - password: ${{ secrets.pypi_token }} + - name: Publish package distributions to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@release/v1