34
34
CIBW_BUILD : cp311-manylinux_x86_64 cp310-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64
35
35
CIBW_ENVIRONMENT : " CC=gcc FC=gfortran CLIMT_ARCH=Linux"
36
36
if : ${{ runner.os == 'Linux' }}
37
- run : python -m cibuildwheel --output-dir wheelhouse
37
+ run : python -m cibuildwheel --output-dir dist
38
38
39
39
40
40
- name : Build on macOS
45
45
# CIBW_ENVIRONMENT: "CC=gcc-8 FC=gfortran-8 CLIMT_ARCH=Darwin"
46
46
# CIBW_BEFORE_ALL_MACOS: brew remove gcc; brew install gcc@8
47
47
if : ${{ runner.os == 'macOS' }}
48
- run : python -m cibuildwheel --output-dir wheelhouse
48
+ run : python -m cibuildwheel --output-dir dist
49
49
50
50
# - uses: actions/upload-artifact@v3
51
51
# with:
@@ -56,28 +56,33 @@ jobs:
56
56
- name : Install twine
57
57
run : python -m pip install twine
58
58
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
78
87
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