Skip to content

Commit 2c7650e

Browse files
committed
Add auto publish to pypi when pushing a new tag.
1 parent 05a25a9 commit 2c7650e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Tags on PyPi when GitHub creates a release
2+
on:
3+
push:
4+
tags:
5+
- 'v**'
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
fail-fast: false
10+
python-version: 3.9
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install upload dependencies
18+
run: |
19+
python -m pip install --upgrade pip setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: __token__
23+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

0 commit comments

Comments
 (0)