-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (52 loc) · 1.57 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on:
push:
branches: ["*"]
tags: ["*"]
pull_request:
branches: ["*"]
jobs:
build_and_push:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install --user cibuildwheel==2.18.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_TEST: pip install -r requirements-dev.txt
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_BUILD: cp3{8,9,10,11,12}-{manylinux_x86_64,win_amd64}
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: wheels
path: wheelhouse/*.whl
publish:
name: Publish to PyPI
needs: build_and_push
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/download-artifact@v4
with:
name: wheels
path: wheelhouse
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install -r requirements.txt
pip install twine
python setup.py sdist
twine upload dist/*
twine upload wheelhouse/*.whl