Skip to content

Commit 7363d8f

Browse files
authored
Added CI workflows for GitHub
1 parent fc518ba commit 7363d8f

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '**'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.9'
22+
23+
- name: Install build dependencies
24+
run: pip install setuptools wheel
25+
26+
- name: Build package
27+
run: python setup.py sdist bdist_wheel
28+
29+
- name: Upload dist as artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/
34+
35+
deploy:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
if: startsWith(github.ref, 'refs/tags/') && contains('0123456789', github.ref[10])
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Download artifact
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: dist
48+
path: dist/
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: '3.9'
54+
55+
- name: Install twine
56+
run: pip install twine
57+
58+
- name: Upload to PyPI
59+
env:
60+
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
61+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
62+
run: twine upload dist/*

0 commit comments

Comments
 (0)