Skip to content

Commit de50f06

Browse files
authored
Update python-publish.yml
1 parent 176c458 commit de50f06

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,33 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v3
2525
- name: Set up Python
26-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: '3.x'
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip
3232
pip install build
33-
- name: Build package
34-
run: python -m build
35-
- name: Publish package
36-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
33+
- name: Install pypa/build
34+
run: >-
35+
python -m
36+
pip install
37+
build
38+
--user
39+
- name: Build a binary wheel and a source tarball
40+
run: >-
41+
python -m
42+
build
43+
--sdist
44+
--wheel
45+
--outdir dist/
46+
- name: Publish distribution 📦 to Test PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1
48+
with:
49+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
50+
repository-url: https://test.pypi.org/legacy/
51+
- name: Publish distribution 📦 to PyPI
52+
if: startsWith(github.ref, 'refs/tags')
53+
uses: pypa/gh-action-pypi-publish@release/v1
3754
with:
38-
user: __token__
3955
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)