From fb8e5efe87e4f0d3735911e0f44009c37a0bd4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Fri, 9 Jul 2021 11:19:03 +0200 Subject: [PATCH] allow optinal releases on master if its no merge_request to allow it on forks, also adjust the workflow rules to run on release branches ignore Gitlab user also for releases, as all protected branches are synced --- .gitlab-ci.yml | 1 + .gitlab/CI/release.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbf42dd77f..f4e61cc432 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,7 @@ workflow: - if: $CI_MERGE_REQUEST_IID - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $GITLAB_USER_ID != "8866215" + - if: $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ && $GITLAB_USER_ID != "8866215" include: - local: .gitlab/CI/recompile.yml diff --git a/.gitlab/CI/release.yml b/.gitlab/CI/release.yml index 4622002b85..6fa6378edd 100644 --- a/.gitlab/CI/release.yml +++ b/.gitlab/CI/release.yml @@ -2,12 +2,12 @@ .optional-release: stage: check rules: - - if: $CI_PIPELINE_SOURCE != "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ + - if: $CI_PIPELINE_SOURCE != "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ when: never - when: manual allow_failure: true -# Template to only run if pushes to master or a tag happened +# Template to only run if pushes to master, a version tag, or release branch happened .release: stage: build rules: @@ -19,6 +19,6 @@ .release-nightly-tmp-fix-airshipper: stage: build-nightly rules: - - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) + - if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) when: always - when: never