diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 868f931..61ba8b4 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,12 +4,18 @@ on: release: types: - published + workflow_dispatch: jobs: pypi-publish: name: PyPI - if: github.repository_owner == 'juftin' + if: github.repository_owner == 'juftin' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.actor == 'juftin')) runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/llm-term + permissions: + id-token: write steps: - name: Check out the repository uses: actions/checkout@v4 @@ -28,7 +34,4 @@ jobs: run: | hatch build - name: Publish package on PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} + uses: pypa/gh-action-pypi-publish@release/v1