gitlab-ci: Simplify Windows packaging pipeline
In commit 4c7c66dcf5
(gitlab-ci: Add jobs to make Windows x86_64 and
i386 packages, 2022-05-19, v3.24.0-rc1~112^2) we used a separate Windows
packaging job in nightly packaging pipelines. It did not run in release
pipelines, where we need to run the final packaging step manually with
signing. Simplify nightly packaging pipelines by running `cpack` at the
end of the build job as we do for other platforms.
For release packaging pipelines, create an archive of the files needed
to build a package, and present this as the built "package" on Windows.
This commit is contained in:
parent
ce2e825306
commit
0929221ca3
@ -16,7 +16,6 @@ stages:
|
||||
- build
|
||||
- test
|
||||
- test-ext
|
||||
- package
|
||||
- upload
|
||||
|
||||
################################################################################
|
||||
@ -37,7 +36,6 @@ stages:
|
||||
|
||||
# Job prefixes:
|
||||
# - `b:` build
|
||||
# - `k:` package
|
||||
# - `l:` lint
|
||||
# - `p:` prep
|
||||
# - `t:` test
|
||||
@ -1239,27 +1237,13 @@ b:windows-x86_64-package:
|
||||
extends:
|
||||
- .windows_x86_64_package
|
||||
- .cmake_build_windows
|
||||
- .cmake_build_package_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- p:doc-package
|
||||
needs:
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64-build"
|
||||
|
||||
k:windows-x86_64-package:
|
||||
extends:
|
||||
- .windows_x86_64_package
|
||||
- .cmake_package_windows
|
||||
- .cmake_release_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- b:windows-x86_64-package
|
||||
- p:doc-package
|
||||
needs:
|
||||
- b:windows-x86_64-package
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64"
|
||||
|
||||
@ -1268,35 +1252,21 @@ u:windows-x86_64-package:
|
||||
- .rsync_upload_package
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- k:windows-x86_64-package
|
||||
- b:windows-x86_64-package
|
||||
needs:
|
||||
- k:windows-x86_64-package
|
||||
- b:windows-x86_64-package
|
||||
|
||||
b:windows-i386-package:
|
||||
extends:
|
||||
- .windows_i386_package
|
||||
- .cmake_build_windows
|
||||
- .cmake_build_package_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- p:doc-package
|
||||
needs:
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386-build"
|
||||
|
||||
k:windows-i386-package:
|
||||
extends:
|
||||
- .windows_i386_package
|
||||
- .cmake_package_windows
|
||||
- .cmake_release_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- b:windows-i386-package
|
||||
- p:doc-package
|
||||
needs:
|
||||
- b:windows-i386-package
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386"
|
||||
|
||||
@ -1305,35 +1275,21 @@ u:windows-i386-package:
|
||||
- .rsync_upload_package
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- k:windows-i386-package
|
||||
- b:windows-i386-package
|
||||
needs:
|
||||
- k:windows-i386-package
|
||||
- b:windows-i386-package
|
||||
|
||||
b:windows-arm64-package:
|
||||
extends:
|
||||
- .windows_arm64_package
|
||||
- .cmake_build_windows
|
||||
- .cmake_build_package_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022_arm64
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- p:doc-package
|
||||
needs:
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64-build"
|
||||
|
||||
k:windows-arm64-package:
|
||||
extends:
|
||||
- .windows_arm64_package
|
||||
- .cmake_package_windows
|
||||
- .cmake_release_artifacts
|
||||
- .windows_x86_64_tags_nonconcurrent_vs2022_arm64
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- b:windows-arm64-package
|
||||
- p:doc-package
|
||||
needs:
|
||||
- b:windows-arm64-package
|
||||
- p:doc-package
|
||||
variables:
|
||||
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64"
|
||||
|
||||
@ -1342,6 +1298,6 @@ u:windows-arm64-package:
|
||||
- .rsync_upload_package
|
||||
- .run_only_for_package
|
||||
dependencies:
|
||||
- k:windows-arm64-package
|
||||
- b:windows-arm64-package
|
||||
needs:
|
||||
- k:windows-arm64-package
|
||||
- b:windows-arm64-package
|
||||
|
@ -63,35 +63,6 @@
|
||||
- build/DartConfiguation.tcl
|
||||
- build/CTestCustom.cmake
|
||||
|
||||
.cmake_build_package_artifacts:
|
||||
artifacts:
|
||||
expire_in: 1d
|
||||
name: "$CMAKE_CI_ARTIFACTS_NAME"
|
||||
paths:
|
||||
# Allow CPack to find CMAKE_ROOT.
|
||||
- build/CMakeFiles/CMakeSourceDir.txt
|
||||
|
||||
# Install rules.
|
||||
- build/**/cmake_install.cmake
|
||||
|
||||
# We need the main binaries.
|
||||
- build/bin/
|
||||
|
||||
# Pass through the documentation.
|
||||
- build/install-doc/
|
||||
|
||||
# CPack configuration.
|
||||
- build/CPackConfig.cmake
|
||||
- build/CMakeCPackOptions.cmake
|
||||
- build/Source/QtDialog/QtDialogCPack.cmake
|
||||
|
||||
# CPack/IFW packaging files.
|
||||
- build/CMake*.qs
|
||||
|
||||
# CPack/WIX packaging files.
|
||||
- build/Utilities/Release/WiX/custom_action_dll*.wxs
|
||||
- build/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*
|
||||
|
||||
.cmake_release_artifacts:
|
||||
artifacts:
|
||||
expire_in: 5d
|
||||
|
3
.gitlab/ci/CMakeCPack.cmake
Normal file
3
.gitlab/ci/CMakeCPack.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
if(NOT "$ENV{CMAKE_CI_PACKAGE}" MATCHES "^(dev)?$")
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/package_info.cmake.in ${CMake_BINARY_DIR}/ci_package_info.cmake @ONLY)
|
||||
endif()
|
@ -19,4 +19,6 @@ set(CMake_TEST_Qt5 OFF CACHE BOOL "")
|
||||
set(CMake_TEST_Qt6 OFF CACHE BOOL "")
|
||||
set(Python_FIND_REGISTRY NEVER CACHE STRING "")
|
||||
|
||||
set(CMake_CPACK_CUSTOM_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/CMakeCPack.cmake" CACHE FILEPATH "")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
|
||||
|
1
.gitlab/ci/package_info.cmake.in
Normal file
1
.gitlab/ci/package_info.cmake.in
Normal file
@ -0,0 +1 @@
|
||||
set(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@")
|
7
.gitlab/ci/package_windows.ps1
Executable file
7
.gitlab/ci/package_windows.ps1
Executable file
@ -0,0 +1,7 @@
|
||||
if (Test-Path -Path "build/ci_package_info.cmake" -PathType Leaf) {
|
||||
cmake -P .gitlab/ci/package_windows_build.cmake
|
||||
} else {
|
||||
cd build
|
||||
cpack -G ZIP
|
||||
cpack -G WIX
|
||||
}
|
40
.gitlab/ci/package_windows_build.cmake
Normal file
40
.gitlab/ci/package_windows_build.cmake
Normal file
@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
include(build/ci_package_info.cmake)
|
||||
|
||||
set(build "${CMAKE_CURRENT_BINARY_DIR}/build")
|
||||
|
||||
file(GLOB paths RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# Allow CPack to find CMAKE_ROOT.
|
||||
"${build}/CMakeFiles/CMakeSourceDir.txt"
|
||||
|
||||
# We need the main binaries.
|
||||
"${build}/bin"
|
||||
|
||||
# Pass through the documentation.
|
||||
"${build}/install-doc"
|
||||
|
||||
# CPack configuration.
|
||||
"${build}/CPackConfig.cmake"
|
||||
"${build}/CMakeCPackOptions.cmake"
|
||||
"${build}/Source/QtDialog/QtDialogCPack.cmake"
|
||||
|
||||
# CPack/IFW packaging files.
|
||||
"${build}/CMake*.qs"
|
||||
|
||||
# CPack/WIX packaging files.
|
||||
"${build}/Utilities/Release/WiX/custom_action_dll*.wxs"
|
||||
"${build}/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*"
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE paths_recurse RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# Install rules.
|
||||
"${build}/cmake_install.cmake"
|
||||
"${build}/*/cmake_install.cmake"
|
||||
)
|
||||
|
||||
# Create a "package" containing the build-tree files needed to build a package.
|
||||
file(ARCHIVE_CREATE
|
||||
OUTPUT build/${CPACK_PACKAGE_FILE_NAME}.build.zip
|
||||
PATHS ${paths} ${paths_recurse}
|
||||
FORMAT zip
|
||||
)
|
1
.gitlab/ci/post_build_windows_arm64_package.ps1
Executable file
1
.gitlab/ci/post_build_windows_arm64_package.ps1
Executable file
@ -0,0 +1 @@
|
||||
. .gitlab/ci/package_windows.ps1
|
1
.gitlab/ci/post_build_windows_i386_package.ps1
Executable file
1
.gitlab/ci/post_build_windows_i386_package.ps1
Executable file
@ -0,0 +1 @@
|
||||
. .gitlab/ci/package_windows.ps1
|
1
.gitlab/ci/post_build_windows_x86_64_package.ps1
Executable file
1
.gitlab/ci/post_build_windows_x86_64_package.ps1
Executable file
@ -0,0 +1 @@
|
||||
. .gitlab/ci/package_windows.ps1
|
@ -367,18 +367,6 @@
|
||||
|
||||
interruptible: true
|
||||
|
||||
.cmake_package_windows:
|
||||
stage: package
|
||||
|
||||
script:
|
||||
- *before_script_windows
|
||||
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
|
||||
- cd build
|
||||
- cpack -G ZIP
|
||||
- cpack -G WIX
|
||||
|
||||
interruptible: true
|
||||
|
||||
.cmake_test_windows:
|
||||
stage: test
|
||||
|
||||
|
@ -70,7 +70,7 @@
|
||||
when: on_success
|
||||
- if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE == "prep"'
|
||||
when: manual
|
||||
- if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE != "package" && $CI_JOB_STAGE != "upload"'
|
||||
- if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE != "upload"'
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
|
@ -264,5 +264,9 @@ set(CPACK_SOURCE_IGNORE_FILES
|
||||
"~$"
|
||||
)
|
||||
|
||||
if(CMake_CPACK_CUSTOM_SCRIPT)
|
||||
include(${CMake_CPACK_CUSTOM_SCRIPT})
|
||||
endif()
|
||||
|
||||
# include CPack model once all variables are set
|
||||
include(CPack)
|
||||
|
Loading…
Reference in New Issue
Block a user