From dd0cbbe35f11a4df53d384b50c88952bfb34d76a Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Fri, 29 May 2020 16:09:21 +0200 Subject: [PATCH 1/7] Release announcements: s/kusama/polkadot/ --- .github/workflows/release-bot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-bot.yml b/.github/workflows/release-bot.yml index 8e978932e804..a153cddb056a 100644 --- a/.github/workflows/release-bot.yml +++ b/.github/workflows/release-bot.yml @@ -20,13 +20,13 @@ jobs: with: room_id: ${{ secrets.VALIDATOR_LOUNGE_MATRIX_ROOM_ID }} access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} - message: "***Kusama ${{github.event.release.tag_name}} has been released!***
Please update at your earliest convenience.
${{github.event.release.html_url}}

${{github.event.release.body}}
" + message: "***Polkadot ${{github.event.release.tag_name}} has been released!***
Please update at your earliest convenience.
${{github.event.release.html_url}}

${{github.event.release.body}}
" server: "matrix.parity.io" - - name: Kusama Announcements + - name: Polkadot Announcements uses: s3krit/matrix-message-action@v0.0.2 with: room_id: ${{ secrets.KUSAMA_ANNOUNCEMENTS_MATRIX_ROOM_ID }} access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} - message: "***Kusama ${{github.event.release.tag_name}} has been released!***
Please update at your earliest convenience.
${{github.event.release.html_url}}

${{github.event.release.body}}
" + message: "***Polkadot ${{github.event.release.tag_name}} has been released!***
Please update at your earliest convenience.
${{github.event.release.html_url}}

${{github.event.release.body}}
" server: "matrix.parity.io" From 55e88cb48e4029ae4384adb763a2e1c209ab1dab Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Fri, 29 May 2020 16:10:27 +0200 Subject: [PATCH 2/7] Additional debug info for gitlab publish script --- scripts/gitlab/lib.sh | 1 + scripts/gitlab/publish_draft_release.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gitlab/lib.sh b/scripts/gitlab/lib.sh index 40e25b823bc2..262d2171a5cc 100755 --- a/scripts/gitlab/lib.sh +++ b/scripts/gitlab/lib.sh @@ -31,6 +31,7 @@ check_tag () { if [ "$tag_sha" = "null" ]; then return 2 fi + echo "[+] Tag object SHA: $tag_sha" verified_str=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$object_url" | jq -r .verification.verified) if [ "$verified_str" = "true" ]; then # Verified, everything is good diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 146a1c871099..376df141c5da 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -24,7 +24,7 @@ case $? in ;; 1) echo '[!] Tag found but has not been signed. Aborting release.'; exit 1 ;; - 2) echo '[!] Tag not found. Aborting release.'; exit + 2) echo '[!] Tag not found. Aborting release.'; exit 1 esac # Start with referencing current native runtime From 1e71352114d6e26024eb23cd352981d6e150b5e7 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 2 Jun 2020 20:08:36 +0200 Subject: [PATCH 3/7] add rustc version check job --- .gitlab-ci.yml | 5 +++-- scripts/gitlab/lib.sh | 2 ++ scripts/gitlab/publish_draft_release.sh | 19 +++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d136d0e87b45..eed79d6070bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,8 +100,9 @@ publish-draft-release: stage: test image: parity/tools:latest only: - - tags - - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1 + #- tags + #- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1 + - /^[0-9]+$/ script: - ./scripts/gitlab/publish_draft_release.sh interruptible: true diff --git a/scripts/gitlab/lib.sh b/scripts/gitlab/lib.sh index 262d2171a5cc..2b3ab805c510 100755 --- a/scripts/gitlab/lib.sh +++ b/scripts/gitlab/lib.sh @@ -22,8 +22,10 @@ check_tag () { repo=$1 tagver=$2 if [ -n "$GITHUB_RELEASE_TOKEN" ]; then + echo '[+] Fetching tag using privileged token' tag_out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") else + echo '[+] Fetching tag using unprivileged token' tag_out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") fi tag_sha=$(echo "$tag_out" | jq -r .object.sha) diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 376df141c5da..88117fbf8152 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -12,8 +12,9 @@ echo "[+] Cloning substrate to generate list of changes" git clone $substrate_repo $substrate_dir echo "[+] Finished cloning substrate into $substrate_dir" -version="$CI_COMMIT_TAG" -last_version=$(git tag -l | sort -V | grep -B 1 -x "$CI_COMMIT_TAG" | head -n 1) +# TODO: Undo before opening PR (replace CI_COMMIT_SHA with CI_COMMIT_TAG) +version="$CI_COMMIT_SHA" +last_version=$(git tag -l | sort -V | grep -B 1 -x "$CI_COMMIT_SHA" | head -n 1) echo "[+] Version: $version; Previous version: $last_version" # Check that a signed tag exists on github for this version @@ -27,6 +28,13 @@ case $? in 2) echo '[!] Tag not found. Aborting release.'; exit 1 esac +# Pull rustc version used by rust-builder +stable_rustc="$(docker run -ti parity/rust-builder:latest \ + 'rustup default stable > /dev/null 2>&1; rustc --version')" + +nightly_rustc="$(docker run -ti parity/rust-builder:latest \ + 'rustup default nightly > /dev/null 2>&1; rustc --version')" + # Start with referencing current native runtime # and find any referenced PRs since last release # Note: Drop any changes that begin with '[contracts]' or 'contracts:' @@ -41,6 +49,10 @@ release_text="Polkadot native runtime: $polkadot_spec Kusama native runtime: $kusama_spec Westend native runtime: $westend_spec + +Building this project requires the following rustc versions to be installed: +- $stable_rustc +- $nightly_rustc " runtime_changes="" @@ -147,6 +159,9 @@ fi echo "[+] Release text generated: " echo "$release_text" +# TODO: Undo before opening PR +exit + echo "[+] Pushing release to github" # Create release on github release_name="Polkadot CC1 $version" From 6562978a71ee59a2e2ff0dcbabfbee4395f2d0ec Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 2 Jun 2020 21:21:14 +0200 Subject: [PATCH 4/7] fully comment out tag-checking --- scripts/gitlab/publish_draft_release.sh | 30 ++++++++++++------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 88117fbf8152..0d023b16df8a 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -19,21 +19,19 @@ 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/polkadot" "$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 1 -esac - -# Pull rustc version used by rust-builder -stable_rustc="$(docker run -ti parity/rust-builder:latest \ - 'rustup default stable > /dev/null 2>&1; rustc --version')" - -nightly_rustc="$(docker run -ti parity/rust-builder:latest \ - 'rustup default nightly > /dev/null 2>&1; rustc --version')" +# TODO: Uncomment before opening PR +#check_tag "paritytech/polkadot" "$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 1 +#esac + +# Pull rustc version used by rust-builder for stable and nightly +stable_rustc="$(podman run -ti parity/rust-builder:latest rustc +stable --version)" +nightly_rustc="$(podman run -ti parity/rust-builder:latest rustc +nightly --version)" # Start with referencing current native runtime # and find any referenced PRs since last release @@ -50,7 +48,7 @@ Kusama native runtime: $kusama_spec Westend native runtime: $westend_spec -Building this project requires the following rustc versions to be installed: +This release was built with the following versions of \`rustc\`. Other versions may work. - $stable_rustc - $nightly_rustc " From ccdfc0630c32837956df828128aeacff0a900132 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 2 Jun 2020 21:29:13 +0200 Subject: [PATCH 5/7] s/podman/docker/g --- scripts/gitlab/publish_draft_release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 0d023b16df8a..b2cb4eaadb3f 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -30,8 +30,8 @@ echo '[+] Checking tag has been signed' #esac # Pull rustc version used by rust-builder for stable and nightly -stable_rustc="$(podman run -ti parity/rust-builder:latest rustc +stable --version)" -nightly_rustc="$(podman run -ti parity/rust-builder:latest rustc +nightly --version)" +stable_rustc="$(docker run -ti parity/rust-builder:latest rustc +stable --version)" +nightly_rustc="$(docker run -ti parity/rust-builder:latest rustc +nightly --version)" # Start with referencing current native runtime # and find any referenced PRs since last release From 7bc5d5d075059827cc1d462c3cb1b7bd727096aa Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Mon, 8 Jun 2020 13:23:13 +0200 Subject: [PATCH 6/7] Switch to rust-builder image and install jq --- .gitlab-ci.yml | 3 ++- scripts/gitlab/publish_draft_release.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eed79d6070bc..62812a332d26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,12 +98,13 @@ check-line-width: publish-draft-release: stage: test - image: parity/tools:latest + #image: parity/tools:latest only: #- tags #- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1 - /^[0-9]+$/ script: + - apt-get -y update; apt-get -y install jq - ./scripts/gitlab/publish_draft_release.sh interruptible: true allow_failure: true diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index b2cb4eaadb3f..abefcf34631d 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -30,8 +30,8 @@ echo '[+] Checking tag has been signed' #esac # Pull rustc version used by rust-builder for stable and nightly -stable_rustc="$(docker run -ti parity/rust-builder:latest rustc +stable --version)" -nightly_rustc="$(docker run -ti parity/rust-builder:latest rustc +nightly --version)" +stable_rustc="$(rustc +stable --version)" +nightly_rustc="$(rustc +nightly --version)" # Start with referencing current native runtime # and find any referenced PRs since last release From c94f6afee2b036d76caf4af1881f78d91b543fa2 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Mon, 8 Jun 2020 14:02:43 +0200 Subject: [PATCH 7/7] remove temporary TODOs --- .gitlab-ci.yml | 6 ++---- scripts/gitlab/publish_draft_release.sh | 25 ++++++++++--------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62812a332d26..5b9967f3a06a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,11 +98,9 @@ check-line-width: publish-draft-release: stage: test - #image: parity/tools:latest only: - #- tags - #- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1 - - /^[0-9]+$/ + - tags + - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ # i.e. v1.0.1, v2.1.0rc1 script: - apt-get -y update; apt-get -y install jq - ./scripts/gitlab/publish_draft_release.sh diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index abefcf34631d..6fd9179cc947 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -12,22 +12,20 @@ echo "[+] Cloning substrate to generate list of changes" git clone $substrate_repo $substrate_dir echo "[+] Finished cloning substrate into $substrate_dir" -# TODO: Undo before opening PR (replace CI_COMMIT_SHA with CI_COMMIT_TAG) -version="$CI_COMMIT_SHA" -last_version=$(git tag -l | sort -V | grep -B 1 -x "$CI_COMMIT_SHA" | head -n 1) +version="$CI_COMMIT_TAG" +last_version=$(git tag -l | sort -V | grep -B 1 -x "$CI_COMMIT_TAG" | 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' -# TODO: Uncomment before opening PR -#check_tag "paritytech/polkadot" "$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 1 -#esac +check_tag "paritytech/polkadot" "$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 1 +esac # Pull rustc version used by rust-builder for stable and nightly stable_rustc="$(rustc +stable --version)" @@ -157,9 +155,6 @@ fi echo "[+] Release text generated: " echo "$release_text" -# TODO: Undo before opening PR -exit - echo "[+] Pushing release to github" # Create release on github release_name="Polkadot CC1 $version"