@@ -2,10 +2,10 @@ name: Wheels
22
33on :
44 pull_request :
5-
65 push :
7- tags :
8- - " v*"
6+ release :
7+ types :
8+ - published
99
1010jobs :
1111 build_bdist :
@@ -28,19 +28,20 @@ jobs:
2828 arch : x86_64
2929
3030 steps :
31- - uses : actions/checkout@v4
31+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232 with :
3333 fetch-depth : 0
34+ persist-credentials : false
3435
3536 # For aarch64 support
3637 # https://cibuildwheel.pypa.io/en/stable/faq/#emulation
37- - uses : docker/setup-qemu-action@v3
38+ - uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
3839 with :
3940 platforms : all
4041 if : runner.os == 'Linux' && matrix.arch == 'aarch64'
4142
4243 - name : " Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
43- 44+ uses : pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
4445 env :
4546 # Skips pypy and musllinux for now.
4647 CIBW_SKIP : " pp* cp36-* cp37-* cp38-* *-musllinux*"
@@ -52,19 +53,21 @@ jobs:
5253 python -c "import gsw; print(f'gsw v{gsw.__version__}')" &&
5354 python -m pytest --pyargs gsw
5455
55- - uses : actions/upload-artifact@v4
56+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5657 with :
5758 name : pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
5859 path : ${{ github.workspace }}/wheelhouse/*.whl
59-
60+ permissions :
61+ actions : write
6062
6163 build_sdist :
6264 name : Build source distribution
6365 runs-on : ubuntu-22.04
6466 steps :
65- - uses : actions/checkout@v4
67+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6668 with :
6769 fetch-depth : 0
70+ persist-credentials : false
6871
6972 - name : Build sdist
7073 run : >
@@ -73,17 +76,19 @@ jobs:
7376 && twine check dist/*
7477 && check-manifest --verbose
7578
76- - uses : actions/upload-artifact@v4
79+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7780 with :
7881 name : pypi-artifacts
7982 path : ${{ github.workspace }}/dist/*.tar.gz
83+ permissions :
84+ actions : write
8085
8186 show-artifacts :
8287 needs : [build_bdist, build_sdist]
8388 name : " Show artifacts"
8489 runs-on : ubuntu-22.04
8590 steps :
86- - uses : actions/download-artifact@v4
91+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
8792 with :
8893 pattern : pypi-artifacts*
8994 path : ${{ github.workspace }}/dist
9297 - shell : bash
9398 run : |
9499 ls -l ${{ github.workspace }}/dist
95-
100+ permissions :
101+ actions : none
96102
97103 publish-artifacts-pypi :
98104 needs : [build_bdist, build_sdist]
@@ -101,14 +107,16 @@ jobs:
101107 # upload to PyPI for every tag starting with 'v'
102108 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
103109 steps :
104- - uses : actions/download-artifact@v4
110+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
105111 with :
106112 pattern : pypi-artifacts*
107113 path : ${{ github.workspace }}/dist
108114 merge-multiple : true
109115
110- - uses : pypa/gh-action-pypi-publish@release/v1
111- with :
112- user : __token__
113- password : ${{ secrets.PYPI_PASSWORD }}
114- print_hash : true
116+ - name : Publish package distributions to PyPI
117+ uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
118+ environment :
119+ name : release
120+ url : https://pypi.org/p/gsw
121+ permissions :
122+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
0 commit comments