Skip to content

Commit 7690038

Browse files
wanghan-iapcmHan Wang
andauthored
add workflow for publish pypi package (#312)
Co-authored-by: Han Wang <[email protected]>
1 parent c22031d commit 7690038

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/pub-pypi.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Python distributions to PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
if: github.repository_owner == 'deepmodeling'
8+
name: Build and publish Python distributions to PyPI
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@master
15+
with:
16+
python-version: 3.9
17+
18+
- name: Install pypa/build
19+
run: >-
20+
python -m
21+
pip install
22+
build
23+
--user
24+
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+
.
33+
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 }}
39+

0 commit comments

Comments
 (0)