forked from axiak/pyre2
-
Notifications
You must be signed in to change notification settings - Fork 34
98 lines (85 loc) · 2.68 KB
/
main.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build
on:
workflow_dispatch:
pull_request:
#push:
#branches:
#- master
jobs:
cibw_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-13]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.9'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones, plus cross-compile on macos
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: auto arm64
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
CIBW_ARCHS_WINDOWS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*musllinux* *i686"
CIBW_BEFORE_ALL_LINUX: >
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build
CIBW_BEFORE_ALL_MACOS: >
brew install re2 pybind11
# macos target should be 10.14 to get c++17
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg install pkgconf re2:x64-windows
&& vcpkg integrate install
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: ""
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.9'
- name: Build sdist
run: |
pip install build
python -m build -s .
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
check_artifacts:
needs: [build_sdist, cibw_wheels]
defaults:
run:
shell: bash
name: Check artifacts are correct
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
# note wheels should be in subdirectory <upload_name>
- name: Check number of downloaded artifacts
run: ls -l artifact