diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e3343728..0e8f6aaa 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,8 +1,12 @@ name: Publish on: + push: + tags: + - '*' release: - types: [published] + types: + - published permissions: contents: read @@ -10,11 +14,6 @@ permissions: jobs: deploy: runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/subliminal - permissions: - id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -26,6 +25,25 @@ jobs: pip install build - name: Build package run: python -m build + - uses: actions/upload-artifact@v4 + with: + name: Packages + path: dist/* + + publish: + needs: [deploy] + environment: + name: pypi + url: https://pypi.org/p/subliminal + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + name: Packages + path: dist - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: