Skip to content

Commit

Permalink
fix: update ci publish pypi config to use trusted publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
Gandalfmu authored and loonghao committed Jun 13, 2024
1 parent 84e7ef4 commit 5b5310e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -24,13 +28,11 @@ jobs:
run: |
python -m pip install -U pip poetry mkdocs mkdocs-material
poetry --version
poetry install
poetry build
- name: Publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
- name: Create release Version
run: gh release create ${{ steps.vars.outputs.tag }} --generate-notes
env:
Expand Down

0 comments on commit 5b5310e

Please sign in to comment.