Skip to content

Commit e4e0291

Browse files
Merge pull request #8 from r-terada/feature/build_and_release_by_gha
Build sdist/wheel and publish to PyPI by github actions
2 parents b297a9e + b4dd8b0 commit e4e0291

File tree

1 file changed

+35
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)