Skip to content

Commit 4b5ed07

Browse files
authored
Merge pull request #293 from marksweb/feature/release-actions
Added actions to handle pypi releases
2 parents dba3c84 + d4464fb commit 4b5ed07

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
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
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build-n-publish:
10+
name: Build and publish Python 🐍 distributions 📦 to pypi
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
- name: Set up Python 3.9
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.9
18+
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+
.
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 }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Python 🐍 distributions 📦 to TestPyPI
2+
3+
on: pull_request
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
8+
runs-on: ubuntu-latest
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+
16+
- name: Install pypa/build
17+
run: >-
18+
python -m
19+
pip install
20+
build
21+
--user
22+
- name: Build a binary wheel and a source tarball
23+
run: >-
24+
python -m
25+
build
26+
--sdist
27+
--wheel
28+
--outdir dist/
29+
.
30+
31+
- name: Publish distribution 📦 to Test PyPI
32+
uses: pypa/gh-action-pypi-publish@master
33+
with:
34+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
35+
repository_url: https://test.pypi.org/legacy/
36+
skip_existing: true

0 commit comments

Comments
 (0)