File tree Expand file tree Collapse file tree 1 file changed +40
-17
lines changed Expand file tree Collapse file tree 1 file changed +40
-17
lines changed Original file line number Diff line number Diff line change 1- # This workflows will upload a Python Package using Twine when a release is created
2- # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4- name : Publish package
1+ # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-pypi
2+ name : Upload Python Package
53
64on :
75 release :
8- types : [created]
6+ types : [published]
7+
8+ permissions :
9+ contents : read
910
1011jobs :
11- deploy :
12+ release-build :
1213 runs-on : ubuntu-latest
1314
1415 steps :
1516 - uses : actions/checkout@v4
1617
17- - name : Set up Python
18- uses : actions/setup-python@v5
18+ - uses : actions/setup-python@v5
1919 with :
2020 python-version : " 3.x"
2121
22- - name : Install dependencies
22+ - name : Build release distributions
2323 run : |
24- python -m pip install --upgrade pip
25- pip install build
24+ python -m pip install build
25+ python -m build
26+
27+ - name : Upload distributions
28+ uses : actions/upload-artifact@v4
29+ with :
30+ name : release-dists
31+ path : dist/
32+
33+ pypi-publish :
34+ runs-on : ubuntu-latest
35+
36+ needs :
37+ - release-build
38+
39+ permissions :
40+ # IMPORTANT: this permission is mandatory for trusted publishing
41+ id-token : write
2642
27- - name : Build package
28- run : python -m build
43+ # Dedicated environments with protections for publishing are strongly recommended.
44+ environment :
45+ name : pypi
46+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
47+ url : https://pypi.org/p/whatthepatch
2948
30- - name : Publish package
31- uses : pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # release/v1
49+ steps :
50+ - name : Retrieve release distributions
51+ uses : actions/download-artifact@v4
3252 with :
33- user : __token__
34- password : ${{ secrets.PYPI_API_TOKEN }}
53+ name : release-dists
54+ path : dist/
55+
56+ - name : Publish release distributions to PyPI
57+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments