Skip to content

Commit 974d996

Browse files
authored
Add publish step to TestPyPI (#3014)
1 parent 738888e commit 974d996

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

.github/workflows/build_wheels.yml

+10-18
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,7 @@ jobs:
6060
name: Publish wheels on pypi
6161
needs: [build_wheels, build_sdist]
6262
runs-on: ubuntu-latest
63-
if: github.event_name == 'release' && github.event.action == 'created'
6463
steps:
65-
- uses: actions/checkout@v3
66-
67-
- name: Set up Python 3.11
68-
uses: actions/setup-python@v4
69-
with:
70-
python-version: '3.11'
71-
72-
- name: install requirements
73-
run: pip install twine==4.0.2
74-
7564
- uses: actions/download-artifact@v3
7665
with:
7766
name: bdist_files
@@ -82,11 +71,14 @@ jobs:
8271
name: sdist_files
8372
path: dist
8473

85-
- name: check
86-
run: twine check dist/*
74+
- name: Publish package to TestPyPI
75+
uses: pypa/gh-action-pypi-publish@release/v1
76+
with:
77+
password: ${{ secrets.TEST_PYPI_TOKEN }} # TODO: confirm this token exists (or use trusted publishing instead)
78+
repository-url: https://test.pypi.org/legacy/
8779

88-
- name: upload
89-
run: twine upload dist/*
90-
env:
91-
TWINE_USERNAME: __token__
92-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
80+
- name: Publish package to PyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+
if: github.event_name == 'release' && github.event.action == 'created'
83+
with:
84+
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)