From 3a9a9a3ace76c2d3b8b08d60dc219bffcc619928 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 4 Apr 2022 12:51:10 -0400 Subject: gitlab-ci: clarify name of package upload job template The template is used to upload both source and binary packages. --- .gitlab-ci.yml | 10 +++++----- .gitlab/upload.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06570d9..838b8fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,7 @@ p:doc-package: .u:source-package: extends: - - .rsync_upload_binary + - .rsync_upload_package - .run_only_for_package dependencies: - p:source-package @@ -531,7 +531,7 @@ b:linux-x86_64-package: .u:linux-x86_64-package: extends: - - .rsync_upload_binary + - .rsync_upload_package - .run_only_for_package dependencies: - b:linux-x86_64-package @@ -555,7 +555,7 @@ b:linux-aarch64-package: .u:linux-aarch64-package: extends: - - .rsync_upload_binary + - .rsync_upload_package - .run_only_for_package dependencies: - b:linux-aarch64-package @@ -696,7 +696,7 @@ b:macos-package: .u:macos-package: extends: - - .rsync_upload_binary + - .rsync_upload_package - .run_only_for_package dependencies: - b:macos-package @@ -719,7 +719,7 @@ b:macos10.10-package: .u:macos10.10-package: extends: - - .rsync_upload_binary + - .rsync_upload_package - .run_only_for_package dependencies: - b:macos10.10-package diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml index 693388d..287b105 100644 --- a/.gitlab/upload.yml +++ b/.gitlab/upload.yml @@ -1,6 +1,6 @@ # Steps for uploading artifacts -.rsync_upload_binary: +.rsync_upload_package: image: "fedora:34" stage: upload tags: -- cgit v0.12 From cb44e0d47c2ea63f60688a254f6018a8c435a554 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 4 Apr 2022 12:08:40 -0400 Subject: gitlab-ci: distinguish release and development pipeline schedules Redefine the `CMAKE_CI_PACKAGE` pipeline schedule variable to indicate whether it is for a development version (`dev`) or a release version (`v[0-9]...`). Use this to automatically turn package upload jobs on or off without having to edit the jobs in `.gitlab-ci.yml` for release branches. --- .gitlab-ci.yml | 20 +++++--------------- .gitlab/rules.yml | 12 ++++++++---- .gitlab/upload.yml | 3 +++ Help/dev/maint.rst | 18 +----------------- 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 838b8fc..d5529df 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,7 +59,7 @@ p:doc-package: - .cmake_doc_artifacts - .run_only_for_package -.u:source-package: +u:source-package: extends: - .rsync_upload_package - .run_only_for_package @@ -67,8 +67,6 @@ p:doc-package: - p:source-package needs: - p:source-package - variables: - RSYNC_DESTINATION: dev # Documentation builds @@ -529,7 +527,7 @@ b:linux-x86_64-package: needs: - p:doc-package -.u:linux-x86_64-package: +u:linux-x86_64-package: extends: - .rsync_upload_package - .run_only_for_package @@ -537,8 +535,6 @@ b:linux-x86_64-package: - b:linux-x86_64-package needs: - b:linux-x86_64-package - variables: - RSYNC_DESTINATION: dev b:linux-aarch64-package: extends: @@ -553,7 +549,7 @@ b:linux-aarch64-package: needs: - p:doc-package -.u:linux-aarch64-package: +u:linux-aarch64-package: extends: - .rsync_upload_package - .run_only_for_package @@ -561,8 +557,6 @@ b:linux-aarch64-package: - b:linux-aarch64-package needs: - b:linux-aarch64-package - variables: - RSYNC_DESTINATION: dev ## Sanitizer builds @@ -694,7 +688,7 @@ b:macos-package: needs: - p:doc-package -.u:macos-package: +u:macos-package: extends: - .rsync_upload_package - .run_only_for_package @@ -702,8 +696,6 @@ b:macos-package: - b:macos-package needs: - b:macos-package - variables: - RSYNC_DESTINATION: dev b:macos10.10-package: extends: @@ -717,7 +709,7 @@ b:macos10.10-package: needs: - p:doc-package -.u:macos10.10-package: +u:macos10.10-package: extends: - .rsync_upload_package - .run_only_for_package @@ -725,8 +717,6 @@ b:macos10.10-package: - b:macos10.10-package needs: - b:macos10.10-package - variables: - RSYNC_DESTINATION: dev # Windows builds diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index a871b8f..88aa8e6 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -2,7 +2,7 @@ .run_manually: rules: - - if: '$CMAKE_CI_PACKAGE == "true"' + - if: '$CMAKE_CI_PACKAGE != null' when: never - if: '$CMAKE_CI_NIGHTLY == "true"' when: on_success @@ -23,7 +23,7 @@ .run_automatically: rules: - - if: '$CMAKE_CI_PACKAGE == "true"' + - if: '$CMAKE_CI_PACKAGE != null' when: never - if: '$CMAKE_CI_NIGHTLY == "true"' when: on_success @@ -44,7 +44,7 @@ .run_dependent: rules: - - if: '$CMAKE_CI_PACKAGE == "true"' + - if: '$CMAKE_CI_PACKAGE != null' when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_NIGHTLY_IGNORE_DEPS == "true")' when: always @@ -62,7 +62,11 @@ .run_only_for_package: rules: - - if: '$CMAKE_CI_PACKAGE == "true"' + - if: '$CMAKE_CI_PACKAGE != null && $CMAKE_CI_JOB_UPLOAD_PACKAGE == null' + when: on_success + - if: '$CMAKE_CI_PACKAGE == "dev" && $CMAKE_CI_JOB_UPLOAD_PACKAGE == "true"' + variables: + RSYNC_DESTINATION: "dev" when: on_success - when: never diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml index 287b105..88ceba8 100644 --- a/.gitlab/upload.yml +++ b/.gitlab/upload.yml @@ -18,6 +18,9 @@ - ssh-keygen -y -f $RSYNC_BINARY_KEY > $RSYNC_BINARY_KEY.pub - rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@cmake.org:$RSYNC_DESTINATION/ + variables: + CMAKE_CI_JOB_UPLOAD_PACKAGE: "true" + .rsync_upload_help: stage: upload image: "fedora:34" diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst index 54d627d..4c2b6a1 100644 --- a/Help/dev/maint.rst +++ b/Help/dev/maint.rst @@ -245,20 +245,6 @@ Commit with a message such as:: Release versions do not have the development topic section of the CMake Release Notes index page. -Update ``.gitlab-ci.yml`` to drop the upload jobs from the -packaging pipeline by renaming them to start in ``.``: - -.. code-block:: shell - - sed -i 's/^u:/.u:/' .gitlab-ci.yml - -Commit with a message such as:: - - gitlab-ci: Drop package pipeline upload jobs for release branch - - The package pipeline for release versions should not upload packages - automatically to our archive of nightly development versions. - Update ``Source/CMakeVersion.cmake`` to set the version to ``$major.$minor.0-rc0``: @@ -290,15 +276,13 @@ Merge the ``release-$ver`` branch to ``master``: git merge --no-ff release-$ver Begin post-release development by restoring the development branch release -note infrastructure, the nightly package pipeline upload jobs, and -the version date from ``origin/master``: +note infrastructure, and the version date from ``origin/master``: .. code-block:: shell git checkout origin/master -- \ Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst - sed -i 's/^\.u:/u:/' .gitlab-ci.yml Update ``Source/CMakeVersion.cmake`` to set the version to ``$major.$minor.$date``: -- cgit v0.12