Skip to content

Commit 32cbe61

Browse files
authored
Add GitHub Action to publish releases
1 parent 7522073 commit 32cbe61

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
push:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
deploy:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine
27+
28+
- name: Build packages
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
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+
38+
- name: Publish distribution 📦 to PyPI
39+
if: github.event_name == 'release'
40+
uses: pypa/gh-action-pypi-publish@master
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)