diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 95739aa..b31aaff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,9 +17,10 @@ jobs: if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Build wheels')) uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@a138926f6e4f9667d1306c24f24f5bdcaa01fbab # v2.5.0 secrets: - pypi_token: ${{ secrets.pypi_token }} anaconda_token: ${{ secrets.anaconda_token }} with: + upload_to_pypi: false + save_artifacts: true targets: | - cp3*-manylinux_x86_64 - cp3*-musllinux_x86_64 @@ -35,3 +36,30 @@ jobs: anaconda_user: astropy anaconda_package: astropy-healpix anaconda_keep_n_latest: 10 + + upload: + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/project/astropy-healpix + if: >- + ${{ startsWith(github.ref, 'refs/tags/v') && + !endsWith(github.ref, '.dev') && + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) + }} + name: Upload release to PyPI + runs-on: ubuntu-latest + needs: [publish] + steps: + - name: Download artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + merge-multiple: true + pattern: dist-* + path: dist + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0