File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Release to PyPI using Trusted Publishing
2+ # This workflow is triggered when a release is published on GitHub.
3+ #
4+ # https://docs.pypi.org/trusted-publishers/
5+ # https://docs.pypi.org/trusted-publishers/adding-a-publisher/
6+ # https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
7+ # https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments
8+
19name : Release
210
311on :
1018 # Release
1119 name : Release
1220 runs-on : ubuntu-latest
21+ environment :
22+ name : pypi-release
23+ permissions :
24+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
25+ contents : write
1326
1427 steps :
1528 # Checkout the repository
@@ -27,17 +40,12 @@ jobs:
2740 run : |
2841 python -m pip install --upgrade pip
2942 python -m pip install --upgrade build
30- python -m pip install --upgrade setuptools wheel twine
31-
32- # Package and Upload to PyPI
33- - name : Package and Upload to PyPI
34- env :
35- STACKMANAGER_VERSION : ${{ github.event.release.tag_name }}
36- TWINE_USERNAME : __token__
37- TWINE_PASSWORD : ${{ secrets.PYPI_APIKEY }}
43+ python -m pip install --upgrade setuptools wheel
44+
45+ # Build Package
46+ - name : Package
3847 run : |
3948 python -m build
40- python -m twine upload dist/*
4149
4250 # Add Assets to Release on GitHub
4351 - name : Add Assets to Release on GitHub
4755 # The name of the file(s) to upload
4856 files : |
4957 dist/*
58+
59+ # Publish to PyPI using Trusted Publishing
60+ - name : Upload to PyPI
61+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments