mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Build the Bonsai Viewer in CI with the Autodesk connector bundled
Compile the Bonsai Viewer as part of the Linux and Windows binary builds, and ship the Autodesk connector alongside the viewer executable. Qt6 dependencies: - The viewer links Qt6::Svg for runtime icon tinting. Svg is a separate base-Qt archive, so aqt now installs "qtbase qtsvg" (plus icu on Linux) rather than qtbase alone, on both Linux and Windows. - Qt6::CorePrivate is exposed differently across Qt versions: Qt 6.8 ships the target inside Qt6Core, while Qt 6.10 provides it only as a separate CorePrivate config package. The viewer CMakeLists requests it via OPTIONAL_COMPONENTS so it resolves on both. - When cross-compiling Windows ARM64, windeployqt runs from the host x64 Qt, so qtsvg is installed into the host Qt as well. Windows build: - build-all-win.py passed -DBUILD_IFCVIEWER, a flag since renamed to BUILD_BONSAIVIEWER, so the Windows build compiled no viewer at all. It now passes -DBUILD_BONSAIVIEWER. - The Autodesk connector is bundled under connectors/ next to BonsaiViewer.exe in the packaged archive, mirroring the Linux builds. - The Windows workflow builds the connector (PyInstaller) before the main build so it is available to bundle. Connector bundling: - The Linux rocky workflows build the connector and bundle it into the BonsaiViewer archive; the Windows build now does the same. Generated with the assistance of an AI coding tool. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -17,9 +17,11 @@ jobs:
|
||||
bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \
|
||||
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
||||
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
||||
findutils xz byacc patchelf libxkbcommon-devel
|
||||
findutils xz byacc patchelf libxkbcommon-devel \
|
||||
python3.11 python3.11-pip python3.11-tkinter
|
||||
python3 -m pip install typing_extensions aqtinstall
|
||||
git config --global --add safe.directory '*'
|
||||
python3.11 -c "import tkinter; print('Tk', tkinter.TkVersion)"
|
||||
|
||||
- name: Install aws cli
|
||||
run: |
|
||||
@@ -87,6 +89,11 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=v`cat VERSION`
|
||||
python3.11 -m pip install "src/bonsaiviewer-autodesk[build]"
|
||||
python3.11 src/bonsaiviewer-autodesk/packaging/build.py
|
||||
autodesk_connector_dir="$PWD/src/bonsaiviewer-autodesk/dist/autodesk"
|
||||
test -d "$autodesk_connector_dir"
|
||||
|
||||
cd ./build/`uname`/*/install/ifcopenshell
|
||||
mkdir -p ~/output
|
||||
install_root="$PWD"
|
||||
@@ -205,6 +212,10 @@ jobs:
|
||||
patchelf --set-rpath '$ORIGIN' "$package_dir/$exe"
|
||||
stage_runtime_payload "$package_dir"
|
||||
stage_qt_runtime_payload "$exe_path" "$package_dir"
|
||||
if [ "$exe" = "BonsaiViewer" ]; then
|
||||
mkdir -p "$package_dir/connectors"
|
||||
cp -a "$autodesk_connector_dir" "$package_dir/connectors/"
|
||||
fi
|
||||
check_runtime_dependencies "$package_dir"
|
||||
pushd "$package_dir" > /dev/null
|
||||
zip -y -qq -r "$HOME/output/${exe}-${VERSION}-${GITHUB_SHA:0:7}-linux64.zip" .
|
||||
|
||||
@@ -17,9 +17,11 @@ jobs:
|
||||
bzip2 patch mesa-libGL-devel libffi-devel fontconfig-devel \
|
||||
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
||||
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
||||
findutils xz byacc patchelf libxkbcommon-devel
|
||||
findutils xz byacc patchelf libxkbcommon-devel \
|
||||
python3.11 python3.11-pip python3.11-tkinter
|
||||
python3 -m pip install typing_extensions aqtinstall
|
||||
git config --global --add safe.directory '*'
|
||||
python3.11 -c "import tkinter; print('Tk', tkinter.TkVersion)"
|
||||
|
||||
- name: Install aws cli
|
||||
run: |
|
||||
@@ -87,6 +89,11 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=v`cat VERSION`
|
||||
python3.11 -m pip install "src/bonsaiviewer-autodesk[build]"
|
||||
python3.11 src/bonsaiviewer-autodesk/packaging/build.py
|
||||
autodesk_connector_dir="$PWD/src/bonsaiviewer-autodesk/dist/autodesk"
|
||||
test -d "$autodesk_connector_dir"
|
||||
|
||||
cd ./build/`uname`/*/install/ifcopenshell
|
||||
mkdir -p ~/output
|
||||
install_root="$PWD"
|
||||
@@ -206,6 +213,10 @@ jobs:
|
||||
patchelf --set-rpath '$ORIGIN' "$package_dir/$exe"
|
||||
stage_runtime_payload "$package_dir"
|
||||
stage_qt_runtime_payload "$exe_path" "$package_dir"
|
||||
if [ "$exe" = "BonsaiViewer" ]; then
|
||||
mkdir -p "$package_dir/connectors"
|
||||
cp -a "$autodesk_connector_dir" "$package_dir/connectors/"
|
||||
fi
|
||||
check_runtime_dependencies "$package_dir"
|
||||
pushd "$package_dir" > /dev/null
|
||||
zip -y -qq -r "$HOME/output/${exe}-${VERSION}-${GITHUB_SHA:0:7}-linuxarm64.zip" .
|
||||
|
||||
@@ -63,6 +63,24 @@ jobs:
|
||||
# and with default 500MB some cache gets deleted, leading to misses.
|
||||
max-size: 5000MB
|
||||
|
||||
- name: Set up Python for connector build
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
# The connector's PyInstaller bundle embeds a tkinter GUI; verify Tk is
|
||||
# present so a missing-tk regression fails here, not inside the build.
|
||||
- name: Verify tkinter is available
|
||||
run: python -c "import tkinter; print('Tk', tkinter.TkVersion)"
|
||||
|
||||
# Build the Autodesk connector before the C++ build: build-all-win.py
|
||||
# bundles it next to BonsaiViewer.exe while archiving the executables.
|
||||
- name: Build Autodesk connector
|
||||
working-directory: src/bonsaiviewer-autodesk
|
||||
run: |
|
||||
python -m pip install ".[build]"
|
||||
python packaging/build.py
|
||||
|
||||
- name: Run Build Script And Pack .zip Archives
|
||||
shell: cmd
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user