diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d8d1fc2..38c4f90 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,48 +27,6 @@ jobs: name: python-package-distributions path: dist/ - publish-to-testpypi: - name: Test publishing to testpypi - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: - - build - environment: - name: testpypi - url: https://test.pypi.org/p/topen - permissions: - id-token: write - steps: - - name: Grab dist files - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Send off to TestPyPi - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - - publish-to-pypi: - name: Publish dist to pypi - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: - - build - environment: - name: pypi - url: https://pypi.org/p/topen - permissions: - id-token: write - steps: - - name: Grab dist files - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Send off to PyPi - uses: pypa/gh-action-pypi-publish@release/v1 - create-release: name: Create github release runs-on: ubuntu-latest @@ -93,3 +51,46 @@ jobs: uses: softprops/action-gh-release@v2 with: files: dist/* + + publish-to-testpypi: + name: Test publishing to testpypi + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: + - create-release # use github release as sanity check for releases + environment: + name: testpypi + url: https://test.pypi.org/p/topen + permissions: + id-token: write + steps: + - name: Grab dist files + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Send off to TestPyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + publish-to-pypi: + name: Publish dist to pypi + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: + - create-release + environment: + name: pypi + url: https://pypi.org/p/topen + permissions: + id-token: write + steps: + - name: Grab dist files + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Send off to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 +