diff options
author | Brad King <brad.king@kitware.com> | 2023-03-01 14:12:45 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-03-01 09:12:53 -0500 |
commit | 1c1f67a77eaa7915ea08d651f9958703a15e4cf1 (patch) | |
tree | 7b5d2d049066f7c1be719e14d6dcb33cbe92944b /.gitlab/ci | |
parent | 299c37a21dd31276e7241f520ae2e9b8e8c5af03 (diff) | |
parent | 7c60a2625d8940cff786e6c6d432fca3fedacc00 (diff) | |
download | cmake-1c1f67a77eaa7915ea08d651f9958703a15e4cf1.tar.gz |
Merge topic 'ci-package-pipeline'
7c60a2625d gitlab-ci: Optionally upload release packages to custom URL
fc8a981893 gitlab-ci: Generalize package and help upload URLs
f73649823b gitlab-ci: Stage unsigned release package artifacts in a dedicated directory
0929221ca3 gitlab-ci: Simplify Windows packaging pipeline
ce2e825306 gitlab-ci: Simplify macOS packaging jobs
05531a7c4e gitlab-ci: add pre-build and post-build steps to Windows
5ab92d8e71 gitlab-ci: add pre-build and post-build steps to macOS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8266
Diffstat (limited to '.gitlab/ci')
-rw-r--r-- | .gitlab/ci/CMakeCPack.cmake | 3 | ||||
-rw-r--r-- | .gitlab/ci/configure_windows_package_common.cmake | 2 | ||||
-rw-r--r-- | .gitlab/ci/package_info.cmake.in | 1 | ||||
-rw-r--r-- | .gitlab/ci/package_macos.sh | 12 | ||||
-rwxr-xr-x | .gitlab/ci/package_windows.ps1 | 7 | ||||
-rw-r--r-- | .gitlab/ci/package_windows_build.cmake | 41 | ||||
-rwxr-xr-x | .gitlab/ci/post_build.ps1 | 4 | ||||
-rw-r--r-- | .gitlab/ci/post_build_macos10.10_package.sh | 1 | ||||
-rw-r--r-- | .gitlab/ci/post_build_macos_package.sh | 1 | ||||
-rwxr-xr-x | .gitlab/ci/post_build_windows_arm64_package.ps1 | 1 | ||||
-rwxr-xr-x | .gitlab/ci/post_build_windows_i386_package.ps1 | 1 | ||||
-rwxr-xr-x | .gitlab/ci/post_build_windows_x86_64_package.ps1 | 1 | ||||
-rwxr-xr-x | .gitlab/ci/pre_build.ps1 | 4 |
13 files changed, 79 insertions, 0 deletions
diff --git a/.gitlab/ci/CMakeCPack.cmake b/.gitlab/ci/CMakeCPack.cmake new file mode 100644 index 0000000000..971fe54dc4 --- /dev/null +++ b/.gitlab/ci/CMakeCPack.cmake @@ -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() diff --git a/.gitlab/ci/configure_windows_package_common.cmake b/.gitlab/ci/configure_windows_package_common.cmake index 46c0a3e75a..b3929a472a 100644 --- a/.gitlab/ci/configure_windows_package_common.cmake +++ b/.gitlab/ci/configure_windows_package_common.cmake @@ -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") diff --git a/.gitlab/ci/package_info.cmake.in b/.gitlab/ci/package_info.cmake.in new file mode 100644 index 0000000000..f9a5bb778b --- /dev/null +++ b/.gitlab/ci/package_info.cmake.in @@ -0,0 +1 @@ +set(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@") diff --git a/.gitlab/ci/package_macos.sh b/.gitlab/ci/package_macos.sh new file mode 100644 index 0000000000..7625c5d48a --- /dev/null +++ b/.gitlab/ci/package_macos.sh @@ -0,0 +1,12 @@ +cd build +cpack -G TGZ +cpack -G DragNDrop + +case "$CMAKE_CI_PACKAGE" in + dev) + ;; + *) + mkdir -p unsigned + mv cmake-*-macos*-universal.* unsigned/ + ;; +esac diff --git a/.gitlab/ci/package_windows.ps1 b/.gitlab/ci/package_windows.ps1 new file mode 100755 index 0000000000..9ec2942eaf --- /dev/null +++ b/.gitlab/ci/package_windows.ps1 @@ -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 +} diff --git a/.gitlab/ci/package_windows_build.cmake b/.gitlab/ci/package_windows_build.cmake new file mode 100644 index 0000000000..feb379c9be --- /dev/null +++ b/.gitlab/ci/package_windows_build.cmake @@ -0,0 +1,41 @@ +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(MAKE_DIRECTORY build/unsigned) +file(ARCHIVE_CREATE + OUTPUT build/unsigned/${CPACK_PACKAGE_FILE_NAME}.build.zip + PATHS ${paths} ${paths_recurse} + FORMAT zip + ) diff --git a/.gitlab/ci/post_build.ps1 b/.gitlab/ci/post_build.ps1 new file mode 100755 index 0000000000..fbd8ae891c --- /dev/null +++ b/.gitlab/ci/post_build.ps1 @@ -0,0 +1,4 @@ +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName +if (Test-Path -Path ".gitlab/ci/post_build_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { + . ".gitlab/ci/post_build_$env:CMAKE_CONFIGURATION.ps1" +} diff --git a/.gitlab/ci/post_build_macos10.10_package.sh b/.gitlab/ci/post_build_macos10.10_package.sh new file mode 100644 index 0000000000..3b7bc72f38 --- /dev/null +++ b/.gitlab/ci/post_build_macos10.10_package.sh @@ -0,0 +1 @@ +. .gitlab/ci/package_macos.sh diff --git a/.gitlab/ci/post_build_macos_package.sh b/.gitlab/ci/post_build_macos_package.sh new file mode 100644 index 0000000000..3b7bc72f38 --- /dev/null +++ b/.gitlab/ci/post_build_macos_package.sh @@ -0,0 +1 @@ +. .gitlab/ci/package_macos.sh diff --git a/.gitlab/ci/post_build_windows_arm64_package.ps1 b/.gitlab/ci/post_build_windows_arm64_package.ps1 new file mode 100755 index 0000000000..f98d99597d --- /dev/null +++ b/.gitlab/ci/post_build_windows_arm64_package.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/package_windows.ps1 diff --git a/.gitlab/ci/post_build_windows_i386_package.ps1 b/.gitlab/ci/post_build_windows_i386_package.ps1 new file mode 100755 index 0000000000..f98d99597d --- /dev/null +++ b/.gitlab/ci/post_build_windows_i386_package.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/package_windows.ps1 diff --git a/.gitlab/ci/post_build_windows_x86_64_package.ps1 b/.gitlab/ci/post_build_windows_x86_64_package.ps1 new file mode 100755 index 0000000000..f98d99597d --- /dev/null +++ b/.gitlab/ci/post_build_windows_x86_64_package.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/package_windows.ps1 diff --git a/.gitlab/ci/pre_build.ps1 b/.gitlab/ci/pre_build.ps1 new file mode 100755 index 0000000000..3a566877be --- /dev/null +++ b/.gitlab/ci/pre_build.ps1 @@ -0,0 +1,4 @@ +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName +if (Test-Path -Path ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { + . ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1" +} |