-
Notifications
You must be signed in to change notification settings - Fork 22
122 lines (108 loc) · 3.76 KB
/
build_cbsdk.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
name: Build and Release
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'releases/**'
tags:
- v*.*
pull_request:
branches:
- master
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {name: "windows-x64", os: "windows-latest",
qt_arch: "win64_msvc2019_64", qt_ver: "6.4.3",
cmake_extra: "-DCMAKE_PREFIX_PATH='D:\\a\\CereLink\\Qt\\6.4.3\\msvc2019_64' -T v142,host=x86"}
- { name: "macOS-latest", os: "macOS-latest"}
- { name: "jammy", os: "ubuntu-22.04"}
- { name: "focal", os: "ubuntu-20.04"}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies (Ubuntu)
if: startsWith(matrix.config.os, 'ubuntu-')
run: |
sudo apt-get update -y
if [[ "${{ matrix.config.name }}" = focal ]]; then
sudo add-apt-repository -y ppa:okirby/qt6-backports
fi
sudo apt-get install -y cmake qt6-base-dev
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
uses: jurplel/[email protected]
with:
version: ${{ matrix.config.qt_ver }}
arch: ${{ matrix.config.qt_arch }}
- name: Install Dependencies (MacOS)
if: startsWith(matrix.config.os, 'macOS-')
run: brew install qt
- name: Configure CBSDK
run: |
cmake --version
cmake -B build -S . \
-DBUILD_CBMEX=OFF \
-DBUILD_CBOCT=OFF \
-DBUILD_TEST=OFF \
-DBUILD_HDF5=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
-DCPACK_PACKAGE_DIRECTORY=${PWD}/dist \
-DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON \
${{ matrix.config.cmake_extra }}
- name: Build and Package
run: |
cmake --build build --target install --config Release -j
cmake --build build --target package --config Release -j
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: Build Wheels
shell: bash -el {0}
run: |
if [[ "${{ matrix.config.name }}" = windows-x64 ]]; then
cp install/bin/Qt*.dll cerebus/
fi
conda create -n py39 python=3.9 numpy Cython pip wheel setuptools
conda activate py39
pip wheel . -w dist/
conda create -n py310 python=3.10 numpy Cython pip wheel setuptools
conda activate py310
pip wheel . -w dist/
conda create -n py311 python=3.11 numpy Cython pip wheel setuptools
conda activate py311
pip wheel . -w dist/
rm -f dist/numpy*.whl dist/Cython*.whl
# While it would be great if we could use cibuildhweels, this is not realistic because of the Qt6 dependency.
# We could delocate-wheel (Mac) or auditwheel (linux) but these produce huge binaries and it's fairly easy to
# install Qt6 (the only truly missing dependency) on these platforms.
# On Windows, we might want to unzip the wheel, drop in Qt6Core.dll, and then re-zip it.
# I'd rather spend development time removing Qt6 altogether.
- name: Ubuntu - Prefix package with release name
if: startswith(matrix.config.os, 'ubuntu-')
run: |
pushd dist
temp="$(lsb_release -cs)"
for name in *
do
mv "$name" "$(echo $temp)-$name"
done
popd
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
dist/*