Skip to content

Commit 6dc2a0c

Browse files
committed
update pythonpublish workflow
1 parent a9de500 commit 6dc2a0c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Upload Python Package
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [created]
67

78
jobs:
89
deploy:
910
runs-on: ubuntu-latest
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
1014
steps:
1115
- uses: actions/checkout@v3
1216
with:
@@ -27,13 +31,12 @@ jobs:
2731
pip install mkdocs-material
2832
pip install .
2933
pytest
30-
- name: Build and publish
31-
env:
32-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
33-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
34+
- name: Build package
3435
run: |
3536
python setup.py sdist bdist_wheel
36-
twine upload dist/*
37+
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
3740
- name: Deploy mkdocs site
3841
run: |
3942
mkdocs gh-deploy --force

0 commit comments

Comments
 (0)