Skip to content

Commit 0e55e6a

Browse files
committed
Build wheels using GitHub actions.
1 parent 46ee500 commit 0e55e6a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
release:
6+
types: published
7+
jobs:
8+
tar_gz:
9+
name: Package
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-python@master
14+
- run: python setup.py sdist
15+
- uses: actions/upload-artifact@master
16+
with:
17+
name: dist
18+
path: dist
19+
whl:
20+
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
21+
strategy:
22+
matrix:
23+
os: [macOS, Ubuntu, Windows]
24+
minor: [6, 7, 8]
25+
runs-on: ${{ matrix.os }}-latest
26+
steps:
27+
- uses: actions/checkout@master
28+
- uses: actions/setup-python@master
29+
- run: pip install cibuildwheel
30+
- run: cibuildwheel --output-dir dist
31+
env:
32+
CIBW_BUILD: cp3${{ matrix.minor }}-*
33+
CIBW_BEFORE_TEST: pip install -r {project}/requirements.txt
34+
CIBW_TEST_COMMAND: pytest {project}
35+
- uses: actions/upload-artifact@master
36+
with:
37+
name: dist
38+
path: dist
39+
upload:
40+
name: Publish
41+
if: github.event_name == 'release' && github.event.action == 'published'
42+
needs: [tar_gz, whl]
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/download-artifact@master
46+
with:
47+
name: dist
48+
path: dist
49+
- uses: pypa/gh-action-pypi-publish@master
50+
with:
51+
password: ${{ secrets.PYPI_TOKEN }}
52+
skip_existing: true

0 commit comments

Comments
 (0)