Skip to content

Commit

Permalink
make build and deploy to PyPI Github Action use PyPI's new trusted pu…
Browse files Browse the repository at this point in the history
…blishers authentication (#2269)
  • Loading branch information
valeriupredoi authored Dec 7, 2023
1 parent c170325 commit 8131804
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build-and-deploy-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ jobs:
build-n-publish:
name: Build and publish ESMValCore on PyPi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/ESMValCore/
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pep517
Expand All @@ -34,14 +40,10 @@ jobs:
--binary
--out-dir dist/
.
#- name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.test_pypi_password }}
# repository_url: https://test.pypi.org/legacy/
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 8131804

Please sign in to comment.