diff --git a/{{cookiecutter.hyphenated}}/.github/workflows/publish.yml b/{{cookiecutter.hyphenated}}/.github/workflows/publish.yml index 341a537..6bc3e6b 100644 --- a/{{cookiecutter.hyphenated}}/.github/workflows/publish.yml +++ b/{{cookiecutter.hyphenated}}/.github/workflows/publish.yml @@ -27,12 +27,9 @@ jobs: - name: Run tests run: | python -m pytest - deploy: + build: runs-on: ubuntu-latest needs: [test] - environment: release - permissions: - id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python @@ -47,6 +44,25 @@ jobs: - name: Build run: | python -m build - - name: Publish + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-packages + path: dist/ + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: [build] + environment: release + permissions: + id-token: write + steps: + - name: Download distribution packages + uses: actions/download-artifact@v4 + with: + name: python-packages + path: dist/ + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 {% endraw %}