-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (73 loc) · 2.43 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2019]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install PCRE2 (Windows only)
if: matrix.os == 'windows-2019'
shell: bash
run: |
pcre2_version=10.42
download_url=https://github.com/PCRE2Project/pcre2/releases/download/pcre2-{pcre2_version}/pcre2-{pcre2_version}.tar.gz
curl -L $download_url -o pcre2.tar.gz
tar xvzf pcre2.tar.gz
cd pcre2-{pcre2_version}
./configure --prefix={build_dir}
make
make install
- 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 }}