diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad79a57..1fe521e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest environment: release needs: build-test - if: startsWith(github.ref, 'refs/heads/main') + if: startsWith(github.ref, 'refs/tags/') permissions: contents: write id-token: write @@ -68,16 +68,21 @@ jobs: run: | hatch build - name: Publish 📦 to Test PyPI + if: startsWith(github.ref, 'refs/heads/main') uses: pypa/gh-action-pypi-publish@release/v1 with: - skip-existing: true - user: __token__ - password: ${{ secrets.TEST_PYPI_SECRECT }} + id-token: write + environment: release packages-dir: dist/ - repository-url: https://test.pypi.org/legacy/ + # skip-existing: true + # user: __token__ + # password: ${{ secrets.TEST_PYPI_SECRECT }} + # repository-url: https://test.pypi.org/legacy/ - name: Publish 📦 to PyPI + if: startsWith(github.ref, 'refs/heads/main') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.PYPI_SECRECT }} - packages-dir: dist/ + id-token: write + environment: release + # user: __token__ + # password: ${{ secrets.PYPI_SECRECT }}