From 5c76dab097f3cb6c6a739ad3a1502367b9a8bc83 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Tue, 25 Feb 2020 16:48:01 +0100 Subject: [PATCH 1/4] do not check unleash on every PR, only master and tags --- .gitlab-ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fa4a6dadb5d2..000285361661a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -177,10 +177,18 @@ test-dependency-rules: - $DEPLOY_TAG script: - .maintain/ensure-deps.sh - # FIXME set to release + +unleash-check: + stage: test + <<: *docker-env + only: + - master + - tags + script: - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} + test-frame-staking: stage: test <<: *docker-env @@ -561,7 +569,8 @@ publish-to-crates-io: <<: *docker-env dependencies: - build-linux-substrate - - test-dependency-rules + - unleash-check + - publish-draft-release only: - tags - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ From 4ca8ff656ee1f53fce5e23ab1e80b119df8b0464 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Tue, 25 Feb 2020 17:10:47 +0100 Subject: [PATCH 2/4] move scripts folder --- .gitlab-ci.yml | 5 ++--- {scripts => .maintain}/gitlab/lib.sh | 0 {scripts => .maintain}/gitlab/publish_draft_release.sh | 0 3 files changed, 2 insertions(+), 3 deletions(-) rename {scripts => .maintain}/gitlab/lib.sh (100%) rename {scripts => .maintain}/gitlab/publish_draft_release.sh (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 000285361661a..b71625ffda0b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ # script: # - echo "List of shell commands to run in your job" # - echo "You can also just specify a script here, like so:" -# - ./scripts/gitlab/my_amazing_script.sh +# - ./.maintain/gitlab/my_amazing_script.sh stages: - test @@ -188,7 +188,6 @@ unleash-check: - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} - test-frame-staking: stage: test <<: *docker-env @@ -560,7 +559,7 @@ publish-draft-release: - tags - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ script: - - ./scripts/gitlab/publish_draft_release.sh + - ./.maintain/gitlab/publish_draft_release.sh interruptible: true allow_failure: true diff --git a/scripts/gitlab/lib.sh b/.maintain/gitlab/lib.sh similarity index 100% rename from scripts/gitlab/lib.sh rename to .maintain/gitlab/lib.sh diff --git a/scripts/gitlab/publish_draft_release.sh b/.maintain/gitlab/publish_draft_release.sh similarity index 100% rename from scripts/gitlab/publish_draft_release.sh rename to .maintain/gitlab/publish_draft_release.sh From c7c6f720357ab8b1541f7921153230c5f6d86e10 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 25 Feb 2020 17:26:27 +0100 Subject: [PATCH 3/4] add signed-tag check to CI --- .gitlab-ci.yml | 10 ++++++++++ .maintain/gitlab/check_signed.sh | 16 ++++++++++++++++ .maintain/gitlab/publish_draft_release.sh | 11 ----------- 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100755 .maintain/gitlab/check_signed.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b71625ffda0b3..1f9e8ce193c6e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -104,6 +104,16 @@ check-runtime: interruptible: true allow_failure: true +check-signed-tag: + stage: test + image: parity/tools:latest + <<: *kubernetes-build + only: + - tags + - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ + script: + - ./.maintain/gitlab/check_signed.sh + allow_failure: false check-line-width: stage: test diff --git a/.maintain/gitlab/check_signed.sh b/.maintain/gitlab/check_signed.sh new file mode 100755 index 0000000000000..7c4cc47baba38 --- /dev/null +++ b/.maintain/gitlab/check_signed.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# shellcheck source=lib.sh +source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/lib.sh" + +version="$CI_COMMIT_TAG" + +echo '[+] Checking tag has been signed' +check_tag "paritytech/substrate" "$version" +case $? in + 0) echo '[+] Tag found and has been signed'; exit 0 + ;; + 1) echo '[!] Tag found but has not been signed. Aborting release.'; exit 1 + ;; + 2) echo '[!] Tag not found. Aborting release.'; exit 1 +esac diff --git a/.maintain/gitlab/publish_draft_release.sh b/.maintain/gitlab/publish_draft_release.sh index 463d8ee6c853d..8566827a09920 100755 --- a/.maintain/gitlab/publish_draft_release.sh +++ b/.maintain/gitlab/publish_draft_release.sh @@ -14,17 +14,6 @@ version="$CI_COMMIT_TAG" last_version=$(git tag -l | sort -V | grep -B 1 -x "$version" | head -n 1) echo "[+] Version: $version; Previous version: $last_version" -# Check that a signed tag exists on github for this version -echo '[+] Checking tag has been signed' -#check_tag "paritytech/substrate" "$version" -case $? in - 0) echo '[+] Tag found and has been signed' - ;; - 1) echo '[!] Tag found but has not been signed. Aborting release.'; exit 1 - ;; - 2) echo '[!] Tag not found. Aborting release.'; exit -esac - all_changes="$(sanitised_git_logs "$last_version" "$version")" labelled_changes="" echo "[+] Iterating through $(wc -l <<< "$all_changes") changes to find labelled PRs" From 839646e72c1995b9357b9ab22f79236adcbd0070 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 25 Feb 2020 18:10:31 +0100 Subject: [PATCH 4/4] remove publish-to-crates-io dependencies --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f9e8ce193c6e..bc7ce84a80512 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -576,10 +576,6 @@ publish-draft-release: publish-to-crates-io: stage: publish <<: *docker-env - dependencies: - - build-linux-substrate - - unleash-check - - publish-draft-release only: - tags - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/