diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d132d05..30cf746 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build-n-publish: + build: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-20.04 steps: @@ -30,8 +30,29 @@ jobs: --wheel --outdir dist/ . - - name: Publish distribution 📦 to PyPI - #if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + - name: Store the distribution packages + uses: actions/upload-artifact@v3 with: - password: ${{ secrets.PYPI_API_TOKEN }} + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ismrmrmd + permissions: + id-token: ${{ secrets.PYPI_API_TOKEN }} + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file