Skip to content

Commit f7878fd

Browse files
authored
Create publish.yml to publish to pypi
1 parent 867b802 commit f7878fd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)