Skip to content

Commit 5b5310e

Browse files
Gandalfmuloonghao
Gandalfmu
authored andcommitted
fix: update ci publish pypi config to use trusted publisher
1 parent 84e7ef4 commit 5b5310e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/python-publish.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
14+
contents: write
1115
steps:
1216
- uses: actions/checkout@v3
1317
with:
@@ -24,13 +28,11 @@ jobs:
2428
run: |
2529
python -m pip install -U pip poetry mkdocs mkdocs-material
2630
poetry --version
27-
poetry install
31+
poetry build
2832
- name: Publish
29-
env:
30-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
31-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32-
run: |
33-
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
packages-dir: dist
3436
- name: Create release Version
3537
run: gh release create ${{ steps.vars.outputs.tag }} --generate-notes
3638
env:

0 commit comments

Comments
 (0)