Skip to content

Commit f264fe9

Browse files
authored
Add GitHub Actions CI
1 parent 759912b commit f264fe9

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
14+
os: [ubuntu-latest, windows-latest]
15+
include:
16+
- python: "3.6"
17+
tox_env: "py36"
18+
- python: "3.7"
19+
tox_env: "py37"
20+
- python: "3.8"
21+
tox_env: "py38"
22+
- python: "3.9"
23+
tox_env: "py39"
24+
- python: "3.10"
25+
tox_env: "py310"
26+
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python }}
33+
- name: Install tox
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install tox
37+
- name: Test
38+
run: |
39+
tox -e ${{ matrix.tox_env }}
40+
41+
deploy:
42+
43+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
44+
45+
runs-on: ubuntu-latest
46+
47+
needs: build
48+
49+
steps:
50+
- uses: actions/checkout@v1
51+
- name: Set up Python
52+
uses: actions/setup-python@v1
53+
with:
54+
python-version: "3.9"
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install build
59+
- name: Build package
60+
run: |
61+
python -m build
62+
- name: Publish package to PyPI
63+
uses: pypa/gh-action-pypi-publish@master
64+
with:
65+
user: __token__
66+
password: ${{ secrets.pypi_token }}

0 commit comments

Comments
 (0)