From 3efca44b3fa503c73772f71885a638a54067ed21 Mon Sep 17 00:00:00 2001 From: Pedro Rico Pinazo Date: Tue, 16 May 2023 22:48:56 +0100 Subject: [PATCH] add test-publish as a separate job --- .github/workflows/release.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4b0c8d..a0e391a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,10 +44,6 @@ jobs: TYPE: ${{ inputs.type }} - name: Build project run: hatch build - - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - name: Create Git Tag run: | git tag v$(hatch version) @@ -68,9 +64,25 @@ jobs: name: package path: dist/* - publish: + test-publish: needs: [test, release] runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: package + path: dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + publish: + needs: [test, release, test-publish] + runs-on: ubuntu-latest environment: publishing permissions: id-token: write