Skip to content

Commit

Permalink
Using trusted publishing for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Dec 19, 2023
1 parent 9b8b0ed commit aade7f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- dev
pull_request:

jobs:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/wheel-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,36 @@ jobs:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/forestatrisk
permissions:
id-token: write # Mandatory for trusted publishing.
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

upload_testpypi:
# Upload to TestPyPI for dev branch
if: github.ref == 'refs/heads/dev'
name: Upload to TestPyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/forestatrisk
permissions:
id-token: write # Mandatory for trusted publishing.
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.testpypi_password }}
repository-url: https://test.pypi.org/legacy/

# End

0 comments on commit aade7f6

Please sign in to comment.