3434 CIBW_BUILD : cp311-manylinux_x86_64 cp310-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64
3535 CIBW_ENVIRONMENT : " CC=gcc FC=gfortran CLIMT_ARCH=Linux"
3636 if : ${{ runner.os == 'Linux' }}
37- run : python -m cibuildwheel --output-dir wheelhouse
37+ run : python -m cibuildwheel --output-dir dist
3838
3939
4040 - name : Build on macOS
4545 # CIBW_ENVIRONMENT: "CC=gcc-8 FC=gfortran-8 CLIMT_ARCH=Darwin"
4646 # CIBW_BEFORE_ALL_MACOS: brew remove gcc; brew install gcc@8
4747 if : ${{ runner.os == 'macOS' }}
48- run : python -m cibuildwheel --output-dir wheelhouse
48+ run : python -m cibuildwheel --output-dir dist
4949
5050 # - uses: actions/upload-artifact@v3
5151 # with:
@@ -56,28 +56,33 @@ jobs:
5656 - name : Install twine
5757 run : python -m pip install twine
5858
59- - name : mint API token
60- id : mint-token
61- run : |
62- # retrieve the ambient OIDC token
63- resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
64- "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
65- oidc_token=$(jq -r '.value' <<< "${resp}")
66-
67- # exchange the OIDC token for an API token
68- resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
69- api_token=$(jq -r '.token' <<< "${resp}")
70-
71- # mask the newly minted API token, so that we don't accidentally leak it
72- echo "::add-mask::${api_token}"
73-
74- # see the next step in the workflow for an example of using this step output
75- echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
76-
77- TWINE_USERNAME=__token__ TWINE_PASSWORD=${api_token} twine upload wheelhouse/* --verbose
59+ - name : Store the distribution packages
60+ uses : actions/upload-artifact@v4
61+ with :
62+ name : python-package-distributions
63+ path : dist/
64+ publish-to-pypi :
65+ name : Publishing to PyPI
66+ needs :
67+ - build_wheels
68+ runs-on : ubuntu-latest
69+ environment :
70+ name : pypi
71+ url : https://pypi.org/p/climt # Replace <package-name> with your PyPI project name
72+ permissions :
73+ id-token : write # IMPORTANT: mandatory for trusted publishing
74+ steps :
75+ - name : Download all the dists
76+ uses : actions/download-artifact@v4
77+ with :
78+ name : python-package-distributions
79+ path : dist/
80+ - name : Publish wheels to PyPI
81+ uses : pypa/gh-action-pypi-publish@release/v1
82+ # # - name: upload wheels
83+ # # env:
84+ # # TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
85+ # # TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
86+ # # run: twine upload wheelhouse/* --verbose
7887
79- # - name: upload wheels
80- # env:
81- # TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
82- # TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
83- # run: twine upload wheelhouse/* --verbose
88+
0 commit comments