mirror of
https://github.com/zealdocs/zeal.git
synced 2026-08-29 08:34:50 +08:00
ci(github): add windows arm64 builds via qvm (#1892)
This commit is contained in:
@@ -78,7 +78,6 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
- name: Windows Server 2022
|
- name: Windows Server 2022
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
arch: win64_msvc2022_64
|
|
||||||
qt_modules: >-
|
qt_modules: >-
|
||||||
qtpositioning
|
qtpositioning
|
||||||
qtwebchannel
|
qtwebchannel
|
||||||
@@ -89,7 +88,26 @@ jobs:
|
|||||||
publishArtifacts: true
|
publishArtifacts: true
|
||||||
- name: Windows Server 2022 Portable
|
- name: Windows Server 2022 Portable
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
arch: win64_msvc2022_64
|
qt_modules: >-
|
||||||
|
qtpositioning
|
||||||
|
qtwebchannel
|
||||||
|
qtwebengine
|
||||||
|
qt_version: "6.10.2"
|
||||||
|
configurePreset: release-portable
|
||||||
|
buildPreset: release-portable
|
||||||
|
publishArtifacts: true
|
||||||
|
- name: Windows 11 ARM64
|
||||||
|
os: windows-11-arm
|
||||||
|
qt_modules: >-
|
||||||
|
qtpositioning
|
||||||
|
qtwebchannel
|
||||||
|
qtwebengine
|
||||||
|
qt_version: "6.10.2"
|
||||||
|
configurePreset: release
|
||||||
|
buildPreset: release
|
||||||
|
publishArtifacts: true
|
||||||
|
- name: Windows 11 ARM64 Portable
|
||||||
|
os: windows-11-arm
|
||||||
qt_modules: >-
|
qt_modules: >-
|
||||||
qtpositioning
|
qtpositioning
|
||||||
qtwebchannel
|
qtwebchannel
|
||||||
@@ -133,12 +151,14 @@ jobs:
|
|||||||
vcpkgDirectory: ${{ github.workspace }}/.vcpkg
|
vcpkgDirectory: ${{ github.workspace }}/.vcpkg
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4
|
run: |
|
||||||
with:
|
$arch = if ("${{ runner.arch }}" -eq "ARM64") { "arm64" } else { "amd64" }
|
||||||
arch: ${{ matrix.config.arch }}
|
$qvm = "$env:RUNNER_TEMP\qvm.exe"
|
||||||
modules: ${{ matrix.config.qt_modules }}
|
Invoke-WebRequest "https://github.com/trollixx/qvm/releases/latest/download/qvm-$arch.exe" -OutFile $qvm
|
||||||
version: ${{ matrix.config.qt_version }}
|
& $qvm config set install.dir ${{ runner.workspace }}/qt
|
||||||
cache: true
|
$modules = "${{ matrix.config.qt_modules }}".Trim() -replace '\s+', ','
|
||||||
|
& $qvm install ${{ matrix.config.qt_version }} --modules $modules
|
||||||
|
"CMAKE_PREFIX_PATH=$(& $qvm prefix ${{ matrix.config.qt_version }})" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: Configure & Build
|
- name: Configure & Build
|
||||||
uses: lukka/run-cmake@v10
|
uses: lukka/run-cmake@v10
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
- name: Windows Server 2022
|
- name: Windows Server 2022
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
arch: win64_msvc2022_64
|
|
||||||
qt_modules: >-
|
qt_modules: >-
|
||||||
qtpositioning
|
qtpositioning
|
||||||
qtwebchannel
|
qtwebchannel
|
||||||
@@ -38,7 +37,6 @@ jobs:
|
|||||||
uploadPattern: "zeal-*-windows-x64.msi"
|
uploadPattern: "zeal-*-windows-x64.msi"
|
||||||
- name: Windows Server 2022 / Portable
|
- name: Windows Server 2022 / Portable
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
arch: win64_msvc2022_64
|
|
||||||
qt_modules: >-
|
qt_modules: >-
|
||||||
qtpositioning
|
qtpositioning
|
||||||
qtwebchannel
|
qtwebchannel
|
||||||
@@ -47,6 +45,26 @@ jobs:
|
|||||||
configurePreset: release-portable
|
configurePreset: release-portable
|
||||||
buildPreset: release-portable
|
buildPreset: release-portable
|
||||||
uploadPattern: "zeal-*-portable-windows-x64.*"
|
uploadPattern: "zeal-*-portable-windows-x64.*"
|
||||||
|
- name: Windows 11 ARM64
|
||||||
|
os: windows-11-arm
|
||||||
|
qt_modules: >-
|
||||||
|
qtpositioning
|
||||||
|
qtwebchannel
|
||||||
|
qtwebengine
|
||||||
|
qt_version: "6.10.2"
|
||||||
|
configurePreset: release
|
||||||
|
buildPreset: release
|
||||||
|
uploadPattern: "zeal-*-windows-arm64.msi"
|
||||||
|
- name: Windows 11 ARM64 / Portable
|
||||||
|
os: windows-11-arm
|
||||||
|
qt_modules: >-
|
||||||
|
qtpositioning
|
||||||
|
qtwebchannel
|
||||||
|
qtwebengine
|
||||||
|
qt_version: "6.10.2"
|
||||||
|
configurePreset: release-portable
|
||||||
|
buildPreset: release-portable
|
||||||
|
uploadPattern: "zeal-*-portable-windows-arm64.*"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -60,12 +78,14 @@ jobs:
|
|||||||
vcpkgDirectory: ${{ github.workspace }}/.vcpkg
|
vcpkgDirectory: ${{ github.workspace }}/.vcpkg
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4
|
run: |
|
||||||
with:
|
$arch = if ("${{ runner.arch }}" -eq "ARM64") { "arm64" } else { "amd64" }
|
||||||
arch: ${{ matrix.config.arch }}
|
$qvm = "$env:RUNNER_TEMP\qvm.exe"
|
||||||
modules: ${{ matrix.config.qt_modules }}
|
Invoke-WebRequest "https://github.com/trollixx/qvm/releases/latest/download/qvm-$arch.exe" -OutFile $qvm
|
||||||
version: ${{ matrix.config.qt_version }}
|
& $qvm config set install.dir ${{ runner.workspace }}/qt
|
||||||
cache: true
|
$modules = "${{ matrix.config.qt_modules }}".Trim() -replace '\s+', ','
|
||||||
|
& $qvm install ${{ matrix.config.qt_version }} --modules $modules
|
||||||
|
"CMAKE_PREFIX_PATH=$(& $qvm prefix ${{ matrix.config.qt_version }})" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: Configure & Build
|
- name: Configure & Build
|
||||||
uses: lukka/run-cmake@v10
|
uses: lukka/run-cmake@v10
|
||||||
@@ -100,11 +120,12 @@ jobs:
|
|||||||
$dir = Join-Path $env:RUNNER_TEMP 'trusted-signing-client'
|
$dir = Join-Path $env:RUNNER_TEMP 'trusted-signing-client'
|
||||||
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
||||||
nuget install Microsoft.Trusted.Signing.Client -OutputDirectory $dir -ExcludeVersion
|
nuget install Microsoft.Trusted.Signing.Client -OutputDirectory $dir -ExcludeVersion
|
||||||
|
$arch = if ("${{ runner.arch }}" -eq "ARM64") { "arm64" } else { "x64" }
|
||||||
$dlib = Get-ChildItem -Path $dir -Filter 'Azure.CodeSigning.Dlib.dll' -Recurse |
|
$dlib = Get-ChildItem -Path $dir -Filter 'Azure.CodeSigning.Dlib.dll' -Recurse |
|
||||||
Where-Object { $_.FullName -match '[\\/]x64[\\/]' } |
|
Where-Object { $_.FullName -match "[\\/]$arch[\\/]" } |
|
||||||
Select-Object -First 1 -ExpandProperty FullName
|
Select-Object -First 1 -ExpandProperty FullName
|
||||||
if (-not $dlib) {
|
if (-not $dlib) {
|
||||||
throw 'x64 Azure.CodeSigning.Dlib.dll not found in installed package.'
|
throw "$arch Azure.CodeSigning.Dlib.dll not found in installed package."
|
||||||
}
|
}
|
||||||
"CODESIGN_AZURE_DLIB=$dlib" >> $env:GITHUB_ENV
|
"CODESIGN_AZURE_DLIB=$dlib" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
|||||||
+19
-10
@@ -48,19 +48,28 @@ function(setup_vcpkg)
|
|||||||
set(VCPKG_INSTALLED_DIR "${CMAKE_SOURCE_DIR}/build/vcpkg_installed" CACHE STRING "")
|
set(VCPKG_INSTALLED_DIR "${CMAKE_SOURCE_DIR}/build/vcpkg_installed" CACHE STRING "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On Windows, default to a release-only triplet to speed up builds. Switch to the
|
# Match the triplet architecture to the host so native Windows-on-ARM builds link
|
||||||
# default (debug+release) triplet only for true Debug builds — RelWithDebInfo and
|
# against arm64 deps instead of vcpkg's x64 default. PROCESSOR_ARCHITEW6432 covers an
|
||||||
# MinSizeRel still link against release-built deps. Multi-config generators (Visual
|
# x86/x64 process running under emulation on an arm64 host.
|
||||||
# Studio, Ninja Multi-Config, Xcode) leave CMAKE_BUILD_TYPE empty at configure time,
|
|
||||||
# so default to the full triplet to cover every config the user may build.
|
|
||||||
if(WIN32 AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
if(WIN32 AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||||
get_cmake_property(_vcpkg_is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
if("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "ARM64" OR
|
||||||
if(_vcpkg_is_multi_config OR CMAKE_BUILD_TYPE STREQUAL "Debug")
|
"$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "ARM64")
|
||||||
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "")
|
# vcpkg ships no arm64-windows-release triplet, so use the full one.
|
||||||
|
set(VCPKG_TARGET_TRIPLET "arm64-windows" CACHE STRING "")
|
||||||
else()
|
else()
|
||||||
set(VCPKG_TARGET_TRIPLET "x64-windows-release" CACHE STRING "")
|
# On x64, default to a release-only triplet to speed up builds. Switch to the
|
||||||
|
# default (debug+release) triplet only for true Debug builds — RelWithDebInfo and
|
||||||
|
# MinSizeRel still link against release-built deps. Multi-config generators (Visual
|
||||||
|
# Studio, Ninja Multi-Config, Xcode) leave CMAKE_BUILD_TYPE empty at configure time,
|
||||||
|
# so default to the full triplet to cover every config the user may build.
|
||||||
|
get_cmake_property(_vcpkg_is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
if(_vcpkg_is_multi_config OR CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "")
|
||||||
|
else()
|
||||||
|
set(VCPKG_TARGET_TRIPLET "x64-windows-release" CACHE STRING "")
|
||||||
|
endif()
|
||||||
|
unset(_vcpkg_is_multi_config)
|
||||||
endif()
|
endif()
|
||||||
unset(_vcpkg_is_multi_config)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Deploy vcpkg dependencies alongside the build output.
|
# Deploy vcpkg dependencies alongside the build output.
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ if(WIN32)
|
|||||||
# wix extension add --global WixToolset.UI.wixext/5.0.2
|
# wix extension add --global WixToolset.UI.wixext/5.0.2
|
||||||
# wix extension add --global WixToolset.Util.wixext/5.0.2
|
# wix extension add --global WixToolset.Util.wixext/5.0.2
|
||||||
set(CPACK_WIX_VERSION "4")
|
set(CPACK_WIX_VERSION "4")
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
||||||
|
set(CPACK_WIX_ARCHITECTURE "x64")
|
||||||
|
else()
|
||||||
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CPACK_WIX_ARCHITECTURE)
|
||||||
|
endif()
|
||||||
set(CPACK_WIX_UPGRADE_GUID "5C4B6030-A1B4-4EFE-A5AF-28F6FA2E7978")
|
set(CPACK_WIX_UPGRADE_GUID "5C4B6030-A1B4-4EFE-A5AF-28F6FA2E7978")
|
||||||
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT ${CMAKE_PROJECT_HOMEPAGE_URL})
|
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT ${CMAKE_PROJECT_HOMEPAGE_URL})
|
||||||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/src/app/resources/zeal.ico")
|
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/src/app/resources/zeal.ico")
|
||||||
|
|||||||
Reference in New Issue
Block a user