Skip to content

Commit ca96c1c

Browse files
authored
Update python-publish.yml
1 parent da38174 commit ca96c1c

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed
Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# This workflow will upload a Python Package to PyPI when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
91
name: Upload Python Package
102

113
on:
@@ -26,11 +18,14 @@ jobs:
2618
with:
2719
python-version: "3.x"
2820

21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install setuptools wheel twine
25+
2926
- name: Build release distributions
3027
run: |
31-
# NOTE: put your own distribution build steps here.
32-
python -m pip install build
33-
python -m build
28+
python setup.py bdist_wheel
3429
3530
- name: Upload distributions
3631
uses: actions/upload-artifact@v4
@@ -43,19 +38,10 @@ jobs:
4338
needs:
4439
- release-build
4540
permissions:
46-
# IMPORTANT: this permission is mandatory for trusted publishing
4741
id-token: write
4842

49-
# Dedicated environments with protections for publishing are strongly recommended.
50-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
5143
environment:
5244
name: pypi
53-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54-
# url: https://pypi.org/p/YOURPROJECT
55-
#
56-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57-
# ALTERNATIVE: exactly, uncomment the following line instead:
58-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
5945

6046
steps:
6147
- name: Retrieve release distributions
@@ -65,6 +51,8 @@ jobs:
6551
path: dist/
6652

6753
- name: Publish release distributions to PyPI
68-
uses: pypa/gh-action-pypi-publish@release/v1
69-
with:
70-
packages-dir: dist/
54+
env:
55+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
56+
run: |
57+
python -m pip install twine
58+
twine upload dist/*

0 commit comments

Comments
 (0)