From ce344a10cc64f5d5e682fcc660a64e82a0be81bd Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Tue, 21 Apr 2020 19:02:37 +0200 Subject: [PATCH 1/2] Add westend spec version and check labels for polkadot ... And remove reference to `polkadot-master` --- scripts/gitlab/publish_draft_release.sh | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 468e3f9ab397..169dcb33b60e 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -30,14 +30,26 @@ esac # Start with referencing current native runtime # and find any referenced PRs since last release # Note: Drop any changes that begin with '[contracts]' or 'contracts:' -spec=$(grep spec_version runtime/kusama/src/lib.rs | tail -n 1 | grep -Eo '[0-9]{4}') -echo "[+] Spec version: $spec" -release_text="Native for runtime $spec. - -$(sanitised_git_logs "$last_version" "$version" | \ +kusama_spec=$(grep spec_version runtime/kusama/src/lib.rs | tail -n 1 | grep -Eo '[0-9]+') +echo "[+] Kusama spec version: $kusama_spec" +westend_spec=$(grep spec_version runtime/westend/src/lib.rs | tail -n 1 | grep -Eo '[0-9]+') +echo "[+] Westend spec version: $westend_spec" +release_text="Kusama native runtime: $kusama_spec + +Westend native runtime: $westend_spec +" +while IFS= read -r line; do + pr_id=$(echo "$line" | sed -E 's/.*#([0-9]+)\)$/\1/') + if has_label 'paritytech/polkadot' "$pr_id" 'B1-silent'; then + continue + fi + release_text="$release_text +$line" +done <<< "$(sanitised_git_logs "$last_version" "$version" | \ sed '/^\[contracts\].*/d' | \ - sed '/^contracts:.*/d' \ -)" + sed '/^contracts:.*/d' )" + +echo "$release_text" # Get substrate changes between last polkadot version and current cur_substrate_commit=$(grep -A 2 'name = "sc-cli"' Cargo.lock | grep -E -o '[a-f0-9]{40}') @@ -45,7 +57,7 @@ git checkout "$last_version" old_substrate_commit=$(grep -A 2 'name = "sc-cli"' Cargo.lock | grep -E -o '[a-f0-9]{40}') pushd $substrate_dir || exit - git checkout polkadot-master > /dev/null + git checkout master > /dev/null git pull > /dev/null all_substrate_changes="$(sanitised_git_logs "$old_substrate_commit" "$cur_substrate_commit" | sed 's/(#/(paritytech\/substrate#/')" substrate_runtime_changes="" From f0b9a573c4f4dccc76a539020bb2eae4e8ee3d95 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Wed, 22 Apr 2020 16:14:33 +0200 Subject: [PATCH 2/2] Add changelog section for runtimenoteworthy labels And change markdown nesting header style --- scripts/gitlab/publish_draft_release.sh | 29 ++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/scripts/gitlab/publish_draft_release.sh b/scripts/gitlab/publish_draft_release.sh index 169dcb33b60e..42a38ab4cf3f 100755 --- a/scripts/gitlab/publish_draft_release.sh +++ b/scripts/gitlab/publish_draft_release.sh @@ -38,17 +38,34 @@ release_text="Kusama native runtime: $kusama_spec Westend native runtime: $westend_spec " + +runtime_changes="" + while IFS= read -r line; do pr_id=$(echo "$line" | sed -E 's/.*#([0-9]+)\)$/\1/') if has_label 'paritytech/polkadot' "$pr_id" 'B1-silent'; then continue fi + + # If the PR has a runtimenoteworthy label, add to the runtime_changes section + if has_label 'paritytech/polkadot' "$pr_id" 'B1-runtimenoteworthy'; then + runtime_changes="$runtime_changes +$line" + else + # otherwise, add the PR to the main list of changes release_text="$release_text $line" + fi done <<< "$(sanitised_git_logs "$last_version" "$version" | \ sed '/^\[contracts\].*/d' | \ sed '/^contracts:.*/d' )" +if [ -n "$runtime_changes" ]; then + release_text="$release_text + +## Runtime +$runtime_changes" +fi echo "$release_text" # Get substrate changes between last polkadot version and current @@ -96,30 +113,26 @@ if [ -n "$substrate_runtime_changes" ] || [ -n "$substrate_api_changes" ] || [ -n "$substrate_client_changes" ]; then substrate_changes=$(cat << EOF -Substrate changes ------------------ +# Substrate changes EOF ) if [ -n "$substrate_runtime_changes" ]; then substrate_changes="$substrate_changes -Runtime -------- +## Runtime $substrate_runtime_changes" fi if [ -n "$substrate_client_changes" ]; then substrate_changes="$substrate_changes -Client ------- +## Client $substrate_client_changes" fi if [ -n "$substrate_api_changes" ]; then substrate_changes="$substrate_changes -API ---- +## API $substrate_api_changes" fi release_text="$release_text