Skip to content

Commit ae89020

Browse files
Create main.yml
1 parent c697448 commit ae89020

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/main.yml

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

0 commit comments

Comments
 (0)