Skip to content

Commit 917964f

Browse files
committed
CD for pypi
1 parent 8de742e commit 917964f

File tree

1 file changed

+41
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)