Skip to content

Commit 14bc7a1

Browse files
authored
Create release.yml
1 parent 5f822b3 commit 14bc7a1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.10'
17+
- name: Install dependencies
18+
run: |
19+
pip install setuptools wheel twine
20+
- name: Build package
21+
run: |
22+
python setup.py sdist bdist_wheel
23+
- name: Publish to PyPI
24+
if: startsWith(github.ref, 'refs/tags/v')
25+
env:
26+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28+
run: |
29+
twine upload dist/*

0 commit comments

Comments
 (0)