-
Notifications
You must be signed in to change notification settings - Fork 65
140 lines (124 loc) · 3.7 KB
/
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Wheels
on:
push:
branches:
- master
paths:
- ".github/workflows/wheels.yml"
- "python/**"
- "source/**"
pull_request:
branches:
- master
paths:
- ".github/workflows/wheels.yml"
- "python/**"
- "source/**"
release:
types: [published]
workflow_dispatch:
concurrency:
group: wheels-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
archs:
- "x86_64"
- "i686"
impl:
- "manylinux"
- "musllinux"
include:
- os: windows-2022
archs: "AMD64"
impl: win
- os: windows-2022
archs: "x86"
impl: win
- os: macos-13
archs: "universal2"
impl: macosx
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup QEMU for Linux cross-compilation
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Clone LLVM project
shell: bash
run: |
git clone -b release/6.x https://github.com/llvm/llvm-project.git
working-directory: python
- name: Setup LLVM project
shell: bash
run: |
echo 'add_subdirectory(binder)' > python/llvm-project/clang-tools-extra/CMakeLists.txt
cp -r source python/llvm-project/clang-tools-extra/binder
- name: Setup cibuildwheel and build wheels
run: |
pipx install cibuildwheel
pipx run cibuildwheel python
env:
CIBW_BUILD: cp313-${{ matrix.impl }}*
CIBW_ARCHS: ${{ matrix.archs }}
- name: Upload wheels to artifacts
uses: actions/upload-artifact@v4
with:
name: cppbinder-wheels-${{ matrix.os }}-${{ matrix.archs }}-${{ matrix.impl }}-${{ github.event_name == 'release' && github.ref_name || github.sha }}
path: ./wheelhouse/*.whl
build-sdist:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clone LLVM project
shell: bash
run: |
git clone -b release/6.x https://github.com/llvm/llvm-project.git
working-directory: python
- name: Setup LLVM project
shell: bash
run: |
echo 'add_subdirectory(binder)' > python/llvm-project/clang-tools-extra/CMakeLists.txt
cp -r source python/llvm-project/clang-tools-extra/binder
- name: Setup build and build source distribution
run: |
pipx install build
pipx run build --sdist --outdir dist
working-directory: python
- name: Upload source distribution to artifacts
uses: actions/upload-artifact@v4
with:
name: cppbinder-sdist-${{ github.event_name == 'release' && github.ref_name || github.sha }}
path: ./python/dist/*.tar.gz
publish:
needs: [build-wheels, build-sdist]
if: github.event_name == 'release'
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download wheels and source distribution
uses: actions/download-artifact@v4
with:
pattern: cppbinder-*
path: dist
merge-multiple: true
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist