Skip to content

Commit 3be7d24

Browse files
committed
add workflow to publish to pypi
1 parent d366291 commit 3be7d24

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/publish-pypi.yml

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

0 commit comments

Comments
 (0)