-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (57 loc) · 1.87 KB
/
build-wheels.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
64
on:
push:
branches: [ master ]
tags:
- v*
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: cp27-* cp35-* pp* *musl* "*-macosx_arm64"
CIBW_ARCHS_LINUX: "auto64"
CIBW_ARCHS_MACOS: "x86_64"
CIBW_BEFORE_ALL_LINUX: "which yum && yum install -y pcre2-devel zlib-devel"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest -v {package}/tests"
# # Uncomment to get SSH access for testing
# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 15
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
- name: Release wheels
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: wheelhouse/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- name: Deploy to PyPI
if: steps.check-tag.outputs.match == 'true'
run: |
pip3 install twine
python3 -m twine upload wheelhouse/*.whl
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}