Merge branch 'main' into feature/filament_id

This commit is contained in:
SoftFever
2026-09-02 15:34:20 +08:00
49 changed files with 3625 additions and 134 deletions

View File

@@ -33,6 +33,8 @@ on:
- 'build_linux.sh'
- 'build_release_vs.bat'
- 'build_release_vs2022.bat'
- 'build_win.bat'
- 'scripts/test_build_win.ps1'
- 'build_release_macos.sh'
- 'scripts/build_preset_cache.*'
- 'scripts/flatpak/**'
@@ -56,6 +58,22 @@ concurrency:
jobs:
# build_win.bat ships a test suite. Run it before the Windows builds.
check_build_script:
name: Windows build script tests
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# Windows PowerShell rather than pwsh: the suite drives build_win.bat
# through cmd, and the two differ in how they quote native arguments.
- name: Run the build script test suite
shell: powershell
run: .\scripts\test_build_win.ps1
build_linux:
strategy:
fail-fast: false
@@ -81,14 +99,16 @@ jobs:
# SELF_HOSTED skips arm64 (the self-hosted Windows server is x64-only).
matrix:
include: ${{ fromJSON(vars.SELF_HOSTED
&& '[{"arch":"x64","os":"orca-win-server"}]'
|| '[{"arch":"x64","os":"windows-latest"},{"arch":"arm64","os":"windows-11-arm"}]') }}
&& '[{"arch":"x64","os":"orca-win-server","compiler":"clang"}]'
|| '[{"arch":"x64","os":"windows-latest","compiler":"clang"},{"arch":"arm64","os":"windows-11-arm","compiler":"clang"}]') }}
needs: check_build_script
# Don't run scheduled builds on forks:
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
if: ${{ !cancelled() && needs.check_build_script.result == 'success' && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
compiler: ${{ matrix.compiler }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: ${{ github.event_name == 'schedule' }}
secrets: inherit

View File

@@ -9,6 +9,10 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
build-deps-only:
required: false
type: boolean
@@ -33,10 +37,10 @@ jobs:
- name: set outputs
id: set_outputs
env:
# Keep macOS/Windows cache keys architecture-specific. amd64 Linux passes
# no arch (key stays 'linux-clang', preserving the existing cache);
# aarch64 gets its own 'linux-clang-aarch64' key.
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}', inputs.arch) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }}
# Anything that changes how the tree is built belongs in the key, or a job
# restores one it cannot use. Linux amd64 passes no arch deliberately, so
# 'linux-clang' keeps the cache it already has.
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}-{1}', inputs.arch, inputs.compiler) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }}
# ARM64 builds use the build-arm64 tree (see build_release_vs.bat); x64/other use build.
dep-folder-name: ${{ runner.os == 'macOS' && format('/{0}', inputs.arch) || (runner.os == 'Windows' && inputs.arch == 'arm64') && '-arm64/OrcaSlicer_dep' || '/OrcaSlicer_dep' }}
output-cmd: ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
@@ -62,6 +66,7 @@ jobs:
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
compiler: ${{ inputs.compiler }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
secrets: inherit

View File

@@ -16,6 +16,10 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
build-deps-only:
required: false
type: boolean
@@ -135,11 +139,22 @@ jobs:
choco install strawberryperl
}
$arch = "${{ inputs.arch }}"
# -l selects clang-cl and -x Ninja; together they build the deps with clang.
$clang = "${{ inputs.compiler }}" -eq "clang"
$flags = if ($clang) { "-l", "-x" } else { @() }
if ($clang) {
# OpenSSL builds with nmake, which needs a VC environment.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$devArch = if ($arch -eq "arm64") { "arm64" } else { "amd64" }
Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=$devArch"
}
if ($arch -eq "arm64") {
.\build_release_vs.bat deps arm64
.\build_release_vs.bat deps arm64 @flags
.\build_release_vs.bat pack arm64
} else {
.\build_release_vs.bat deps
.\build_release_vs.bat deps @flags
.\build_release_vs.bat pack
}
shell: pwsh
@@ -204,4 +219,5 @@ jobs:
cache-path: ${{ inputs.cache-path }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
compiler: ${{ inputs.compiler }}
secrets: inherit

View File

@@ -13,6 +13,10 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
macos-combine-only:
required: false
type: boolean
@@ -395,7 +399,18 @@ jobs:
# "tests" builds the unit tests too; the unit_tests_windows_* jobs run them.
run: |
$arch = "${{ inputs.arch }}"
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 tests } else { .\build_release_vs.bat slicer tests }
# -l selects clang-cl and -x Ninja; together they build the slicer with clang.
$clang = "${{ inputs.compiler }}" -eq "clang"
$flags = if ($clang) { "-l", "-x" } else { @() }
if ($clang) {
# Build against the same VC toolchain and SDK as the dependencies.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$devArch = if ($arch -eq "arm64") { "arm64" } else { "amd64" }
Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=$devArch"
}
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 @flags tests } else { .\build_release_vs.bat slicer @flags tests }
shell: pwsh
- name: Build system preset cache (Windows)