Skip to content

Commit baace0f

Browse files
authored
Enable trusted publishing (shap#3978)
1 parent e79516b commit baace0f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/build_wheels.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ jobs:
109109
name: Publish wheels to TestPyPI
110110
needs: [build_wheels, build_sdist]
111111
runs-on: ubuntu-latest
112+
environment:
113+
name: testpypi
114+
url: https://test.pypi.org/p/shap
115+
permissions:
116+
id-token: write
112117
steps:
113118
- uses: actions/download-artifact@v4
114119
with:
@@ -125,7 +130,6 @@ jobs:
125130
uses: pypa/gh-action-pypi-publish@release/v1
126131
with:
127132
verbose: true
128-
password: ${{ secrets.TEST_PYPI_TOKEN }}
129133
repository-url: https://test.pypi.org/legacy/
130134

131135
publish_pypi:
@@ -134,6 +138,11 @@ jobs:
134138
runs-on: ubuntu-latest
135139
# Only publish tagged releases to PyPI
136140
if: startsWith(github.ref, 'refs/tags')
141+
environment:
142+
name: pypi
143+
url: https://pypi.org/p/shap
144+
permissions:
145+
id-token: write
137146
steps:
138147
- uses: actions/download-artifact@v4
139148
with:
@@ -148,5 +157,3 @@ jobs:
148157

149158
- name: Publish package to PyPI
150159
uses: pypa/gh-action-pypi-publish@release/v1
151-
with:
152-
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)