Skip to content

Commit e09dd5e

Browse files
author
jagdeep sidhu
committed
Revert "Update publish-to-pypi.yml"
This reverts commit db3bc9d.
1 parent 9b0c42a commit e09dd5e

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ jobs:
6060
name: Publish to TestPyPI
6161
needs: build
6262
runs-on: ubuntu-latest
63-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Publish to TestPyPI on pushes to main
6464

6565
environment:
6666
name: testpypi
67-
url: https://test.pypi.org/p/syscoin-address-converter
67+
url: https://test.pypi.org/p/syscoin-address-converter # Optional: link to TestPyPI project
6868

6969
steps:
7070
- name: Download all the dists
@@ -73,24 +73,25 @@ jobs:
7373
name: python-package-distributions
7474
path: dist/
7575

76-
- name: Install twine
77-
run: python -m pip install twine
78-
7976
- name: Publish distribution to TestPyPI
80-
env:
81-
TWINE_USERNAME: __token__
82-
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
83-
run: python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
77+
uses: pypa/gh-action-pypi-publish@release/v1
78+
with:
79+
repository-url: https://test.pypi.org/legacy/
80+
# Use trusted publishing (recommended)
81+
# Requires configuring trusted publishers in TestPyPI project settings
82+
# https://docs.pypi.org/trusted-publishers/
83+
# Alternatively, use a token:
84+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
8485

8586
publish-to-pypi:
8687
name: Publish to PyPI
8788
needs: build
8889
runs-on: ubuntu-latest
89-
if: github.event_name == 'release' && github.event.action == 'published'
90+
if: github.event_name == 'release' && github.event.action == 'published' # Publish to PyPI on release
9091

9192
environment:
9293
name: pypi
93-
url: https://pypi.org/p/syscoin-address-converter
94+
url: https://pypi.org/p/syscoin-address-converter # Optional: link to PyPI project
9495

9596
steps:
9697
- name: Download all the dists
@@ -99,11 +100,11 @@ jobs:
99100
name: python-package-distributions
100101
path: dist/
101102

102-
- name: Install twine
103-
run: python -m pip install twine
104-
105103
- name: Publish distribution to PyPI
106-
env:
107-
TWINE_USERNAME: __token__
108-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
109-
run: python -m twine upload dist/*
104+
uses: pypa/gh-action-pypi-publish@release/v1
105+
# Use trusted publishing (recommended)
106+
# Requires configuring trusted publishers in PyPI project settings
107+
# https://docs.pypi.org/trusted-publishers/
108+
# Alternatively, use a token:
109+
with:
110+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)