Skip to content

Commit 6e14ba8

Browse files
authored
Add initial script for GH Actions
1 parent d4111ca commit 6e14ba8

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

Diff for: .github/workflows/main.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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: ["2.7", "3.5", "3.6", "3.7", "3.8", "pypy3"]
14+
os: [ubuntu-latest, windows-latest]
15+
include:
16+
- python: "2.7"
17+
tox_env: "py27-pytest31"
18+
- python: "3.5"
19+
tox_env: "py35-pytest31"
20+
- python: "3.6"
21+
tox_env: "py36-pytest31"
22+
- python: "3.7"
23+
tox_env: "py37-pytest31"
24+
- python: "3.8"
25+
tox_env: "py38-pytest31"
26+
- python: "pypy3"
27+
tox_env: "pypy3-pytest31"
28+
29+
steps:
30+
- uses: actions/checkout@v1
31+
- name: Set up Python
32+
uses: actions/setup-python@v1
33+
with:
34+
python-version: ${{ matrix.python }}
35+
- name: Install tox
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install tox
39+
- name: Test
40+
run: |
41+
tox -e ${{ matrix.tox_env }}
42+
43+
deploy:
44+
45+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
46+
47+
runs-on: ubuntu-latest
48+
49+
needs: build
50+
51+
steps:
52+
- uses: actions/checkout@v1
53+
- name: Set up Python
54+
uses: actions/setup-python@v1
55+
with:
56+
python-version: "3.7"
57+
- name: Install wheel
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install wheel
61+
- name: Build package
62+
run: |
63+
python setup.py sdist bdist_wheel
64+
- name: Publish package to PyPI
65+
uses: pypa/gh-action-pypi-publish@master
66+
with:
67+
user: __token__
68+
password: ${{ secrets.pypi_token }}

0 commit comments

Comments
 (0)