Skip to content

Commit 2950b1a

Browse files
committed
Updates for automated pypi publishing
1 parent 5140622 commit 2950b1a

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish Python distribution to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and public Python distribution to PyPI and TestPyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python 3.10
12+
uses: actions/setup-python@v3
13+
with:
14+
python-version: "3.10"
15+
- name: Install pypa/build
16+
run: >-
17+
python -m pip install --user ".[build]"
18+
- name: Build a binary wheel and a source tarball
19+
run: >-
20+
python -m build --sdist --wheel --outdir dist/
21+
- name: Publish Distribution to Test PyPI
22+
uses: pypa/gh-action-pypi-publish@release/v1
23+
with:
24+
password: ${{ secrets.TESTPYPI_API_TOKEN }}
25+
repository_url: https://test.pypi.org/legacy/
26+
- name: Publish Distribution to PyPI
27+
if: startsWith(github.ref, 'refs/tags')
28+
uses: pypa/gh-action-pypi-public@release/v1
29+
with:
30+
password: ${{ secrets.PYPI_API_TOKEN }}

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tests =
5050
isort<5,>=4.2.5
5151

5252
build =
53-
pep517
53+
build
5454

5555
docs =
5656
sphinx

0 commit comments

Comments
 (0)