Bundle Qt DLLs with the Windows wheel #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |