-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (77 loc) · 2.47 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
name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} with label ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: ubuntu-latest
label: "linux-target-x86_64"
- os: macos-13
label: "macos-target-x86_64"
env: MACOSX_DEPLOYMENT_TARGET=10.15
- os: macos-13
label: "macos-target-arm64"
env: MACOSX_DEPLOYMENT_TARGET=11
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set OpenMP env for macos x86_64
if: matrix.label == 'macos-target-x86_64'
run: |
brew install libomp
prefix=$(brew --prefix libomp)
echo "LDFLAGS=$LDFLAGS -L$prefix/lib" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -I$prefix/include" >> $GITHUB_ENV
- name: Set OpenMP env for macos arm64
if: matrix.label == 'macos-target-arm64'
run: |
pkg=$(brew fetch --force --bottle-tag=arm64_ventura libomp | grep 'Downloaded to' | cut -d' ' -f3)
brew install $pkg
prefix=$(brew --prefix libomp)
echo "LDFLAGS=$LDFLAGS -L$prefix/lib" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -I$prefix/include" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Build SDist
run: |
pip install -U build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
# TODO: only run on release
# if: github.event_name == 'release' && github.event.action == 'published'
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1