Skip to content

Commit f16f0dc

Browse files
use trusted publisher routine for PyPI and retire token-based type (#4150)
1 parent 1691ec7 commit f16f0dc

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

.github/workflows/pypi-build-and-deploy.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
build-n-publish:
1414
name: Build and publish ESMValTool on PyPi
1515
runs-on: ubuntu-latest
16+
environment:
17+
name: pypi
18+
url: https://pypi.org/project/ESMValTool/
19+
permissions:
20+
# IMPORTANT: this permission is mandatory for trusted publishing
21+
id-token: write
1622
steps:
1723
- uses: actions/checkout@v5
1824
with:
@@ -35,18 +41,10 @@ jobs:
3541
--binary
3642
--out-dir dist/
3743
.
38-
# Publish on Test PyPi; uncomment to test
39-
# and remember to adjust the triggers above
40-
# - name: Publish distribution 📦 to Test PyPI
41-
# uses: pypa/gh-action-pypi-publish@master
44+
# - name: Publish distribution to Test PyPI
45+
# uses: pypa/gh-action-pypi-publish@release/v1.12.4
4246
# with:
43-
# password: ${{ secrets.test_pypi_password }}
44-
# repository_url: https://test.pypi.org/legacy/
45-
46-
# Publish on PyPi
47+
# repository-url: https://test.pypi.org/legacy/
4748
- name: Publish distribution 📦 to PyPI
4849
if: startsWith(github.ref, 'refs/tags')
49-
uses: pypa/gh-action-pypi-publish@v1.5.0
50-
with:
51-
user: __token__
52-
password: ${{ secrets.pypi_password }}
50+
uses: pypa/gh-action-pypi-publish@release/v1.12.4

0 commit comments

Comments
 (0)