mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
1b920e502f
The Windows branch of the wgpu-native FetchContent block was hardcoding the x86_64 archive name regardless of host arch — the macOS and Linux branches already switch on \`CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64"\`, but Windows didn't get the same treatment because the wgpu work was done on x86_64 hosts. Result on \`windows-11-arm\`: CMake downloaded \`wgpu-windows-x86_64-msvc-release.zip\`, IfcViewerWgpu linked against the x86_64 import library, and the final link of IfcViewerWgpuMinimal/BonsaiViewer emitted ~60 unresolved \`wgpu*\` externs because the import-lib symbols are x86_64-only. Upstream wgpu-native v29.0.0.0 already publishes \`wgpu-windows-aarch64-msvc-release.zip\` — switching on \`CMAKE_SYSTEM_PROCESSOR\` so the right archive gets fetched is sufficient. Also restores the ARM64 row in \`.github/workflows/build_win.yml\` that the prior commit dropped (the comment there was wrong; upstream does ship the binary, our CMake just wasn't asking for it). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
132 lines
4.4 KiB
YAML
132 lines
4.4 KiB
YAML
name: Build IfcOpenShell Windows
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_ifcopenshell:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x64
|
|
runs_on: windows-2022
|
|
deps_dir: _deps-vs2022-x64-installed
|
|
vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"'
|
|
build_branch: windows-x64
|
|
zip_suffix: win64
|
|
|
|
- arch: ARM64
|
|
runs_on: windows-11-arm
|
|
deps_dir: _deps-vs2022-ARM64-installed
|
|
vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat"'
|
|
build_branch: windows-arm64
|
|
zip_suffix: win-arm64
|
|
|
|
runs-on: ${{ matrix.runs_on }}
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Checkout Build Repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: IfcOpenShell/build-outputs
|
|
path: ${{ matrix.deps_dir }}
|
|
ref: ${{ matrix.build_branch }}
|
|
lfs: true
|
|
token: ${{ secrets.BUILD_REPO_TOKEN }}
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
choco install -y sed 7zip.install awscli
|
|
|
|
- name: Unpack Dependencies
|
|
run: |
|
|
cd ${{ matrix.deps_dir }}
|
|
Get-ChildItem -Path . -Filter 'cache-*.zip' | ForEach-Object {
|
|
Write-Host "Extracting $($_.Name)"
|
|
7z x -bso0 -bsp0 $_.FullName
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Failed to extract $($_.Name) with 7z exit code $LASTEXITCODE."
|
|
}
|
|
}
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2.22
|
|
with:
|
|
key: win-${{ matrix.arch }}
|
|
# Windows ccache needs ~1GB
|
|
# 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:
|
|
TARGET_ARCH: ${{ matrix.arch }} # lets the Python script know which arch to target (optional override)
|
|
run: |
|
|
call ${{ matrix.vcvars }}
|
|
cd win
|
|
python build-all-win.py
|
|
|
|
- name: Pack Dependencies
|
|
run: |
|
|
cd ${{ matrix.deps_dir }}
|
|
Get-ChildItem -Path . -Directory | ForEach-Object {
|
|
$cacheFile = "cache-$($_.Name).zip"
|
|
echo $cacheFile
|
|
if (!(Test-Path $cacheFile)) {
|
|
7z a $cacheFile $_.FullName
|
|
}
|
|
}
|
|
|
|
- name: Commit and Push Changes to Build Repository
|
|
run: |
|
|
cd ${{ matrix.deps_dir }}
|
|
git config user.name "IfcOpenBot"
|
|
git config user.email "ifcopenbot@ifcopenshell.org"
|
|
git checkout -B ${{ matrix.build_branch }}
|
|
git add *.zip
|
|
git commit -m "Update build artifacts [skip ci]" || echo "No changes to commit"
|
|
git push --set-upstream origin ${{ matrix.build_branch }} || echo "Push failed"
|
|
|
|
- name: Configure AWS Credentials
|
|
uses: aws-actions/configure-aws-credentials@v6
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_UPLOAD_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_UPLOAD_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-1
|
|
|
|
- name: Upload .zip Archives to S3
|
|
env:
|
|
AWS_DEBUG: 1
|
|
AWS_RETRY_MODE: standard
|
|
AWS_MAX_ATTEMPTS: 3
|
|
run: |
|
|
dir "$env:USERPROFILE\output"
|
|
foreach ($zip in Get-ChildItem -Path "$env:USERPROFILE\output" -Filter *.zip) {
|
|
aws s3 cp "$($zip.FullName)" s3://ifcopenshell-builds/ --debug
|
|
Start-Sleep -Seconds 5
|
|
}
|