Skip to content

Commit ee6c3ae

Browse files
committed
CD: Add action to deploy to pypi
1 parent d9bd032 commit ee6c3ae

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

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

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

0 commit comments

Comments
 (0)