Skip to content

Commit

Permalink
[Release/CI] Adjust release pipelines to support new tags and delete …
Browse files Browse the repository at this point in the history
…rococo from release (#6108)

This PR introduces adjustments to the release pipelines so that it could
be used with the new tags in the form of `poilakdot-stableYYMM(-rcX)` in
addition to the old form of tags like `vX.XX.X`.

Also, the rococo runtime and its parachains are deleted now from the
build and release draft as it is decommissioned and not used any more
  • Loading branch information
EgorPopelyaev authored Oct 17, 2024
1 parent a2c7575 commit 1cc760b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 58 deletions.
10 changes: 3 additions & 7 deletions .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,10 @@ function find_runtimes() {
# output: none
filter_version_from_input() {
version=$1
regex="(^v[0-9]+\.[0-9]+\.[0-9]+)$|(^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+)$"
regex="^(v)?[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$"

if [[ $version =~ $regex ]]; then
if [ -n "${BASH_REMATCH[1]}" ]; then
echo "${BASH_REMATCH[1]}"
elif [ -n "${BASH_REMATCH[2]}" ]; then
echo "${BASH_REMATCH[2]}"
fi
echo $version
else
echo "Invalid version: $version"
exit 1
Expand Down Expand Up @@ -462,7 +458,7 @@ function get_polkadot_node_version_from_code() {

validate_stable_tag() {
tag="$1"
pattern="^stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"
pattern="^(polkadot-)?stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"

if [[ $tag =~ $pattern ]]; then
echo $tag
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-10_rc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:
inputs:
version:
description: Current release/rc version in format vX.X.X
description: Current release/rc version in format polkadot-stableYYMM

jobs:
tag_rc:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
if [[ -z "${{ inputs.version }}" ]]; then
version=v$(get_polkadot_node_version_from_code)
else
version=$(filter_version_from_input ${{ inputs.version }})
version=$(validate_stable_tag ${{ inputs.version }})
fi
echo "$version"
echo "version=$version" >> $GITHUB_OUTPUT
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
tags:
# Catches v1.2.3 and v1.2.3-rc1
- v[0-9]+.[0-9]+.[0-9]+*
# - polkadot-stable[0-9]+* Activate when the release process from release org is setteled

workflow_dispatch:
inputs:
Expand All @@ -25,7 +26,7 @@ jobs:
build-runtimes:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
excluded_runtimes: "asset-hub-rococo bridge-hub-rococo contracts-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
build_opts: "--features on-chain-release-build"

build-binaries:
Expand Down Expand Up @@ -79,30 +80,27 @@ jobs:
env:
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASSET_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/asset-hub-rococo-runtime/asset-hub-rococo-srtool-digest.json
ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json
BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-runtime/bridge-hub-rococo-srtool-digest.json
BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json
COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/collectives-westend-runtime/collectives-westend-srtool-digest.json
CONTRACTS_ROCOCO_DIGEST: ${{ github.workspace}}/contracts-rococo-runtime/contracts-rococo-srtool-digest.json
CORETIME_ROCOCO_DIGEST: ${{ github.workspace}}/coretime-rococo-runtime/coretime-rococo-srtool-digest.json
CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/coretime-westend-runtime/coretime-westend-srtool-digest.json
GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/glutton-westend-runtime/glutton-westend-srtool-digest.json
PEOPLE_ROCOCO_DIGEST: ${{ github.workspace}}/people-rococo-runtime/people-rococo-srtool-digest.json
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json
ROCOCO_DIGEST: ${{ github.workspace}}/rococo-runtime/rococo-srtool-digest.json
WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json
shell: bash
run: |
. ./.github/scripts/common/lib.sh
export REF1=$(get_latest_release_tag)
if [[ -z "${{ inputs.version }}" ]]; then
export REF2="${{ github.ref_name }}"
echo "REF2: ${REF2}"
else
export REF2="${{ inputs.version }}"
echo "REF2: ${REF2}"
fi
echo "REL_TAG=$REF2" >> $GITHUB_ENV
export VERSION=$(echo "$REF2" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
export VERSION=$(echo "$REF2" | sed -E 's/.*(stable[0-9]+).*$/\1/')
./scripts/release/build-changelogs.sh
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
release="${{ needs.validate-inputs.outputs.stable_tag }}" && \
echo "release=${release}" >> $GITHUB_OUTPUT
echo "release=${{ needs.validate-inputs.outputs.stable_tag }}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
echo "commit=${commit}" >> $GITHUB_OUTPUT
tag="${{ needs.validate-inputs.outputs.version }}" && \
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "tag=${{ needs.validate-inputs.outputs.version }}" >> $GITHUB_OUTPUT
- name: Fetch release tags
working-directory: release-artifacts
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release-branchoff-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ on:
type: string

node_version:
description: Version of the polkadot node in the format vX.XX.X (e.g. 1.15.0)
description: Version of the polkadot node in the format X.XX.X (e.g. 1.15.0)
required: true

jobs:
# TODO: Activate this job when the pipeline is moved to the fork in the `paritytech-release` org
# check-workflow-can-run:
# uses: paritytech-release/sync-workflows/.github/workflows/check-syncronization.yml@latest
check-workflow-can-run:
uses: paritytech-release/sync-workflows/.github/workflows/check-syncronization.yml@main


prepare-tooling:
needs: [check-workflow-can-run]
if: needs.check-workflow-can-run.outputs.checks_passed == 'true'
runs-on: ubuntu-latest
outputs:
node_version: ${{ steps.validate_inputs.outputs.node_version }}
Expand All @@ -40,9 +41,7 @@ jobs:
echo "stable_version=${stable_version}" >> $GITHUB_OUTPUT
create-stable-branch:
# needs: [check-workflow-can-run, prepare-tooling]
needs: [prepare-tooling]
# if: needs. check-workflow-can-run.outputs.checks_passed == 'true'
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -100,6 +99,6 @@ jobs:
# Set new version for polkadot-parachain binary to match the polkadot node binary
# set_polkadot_parachain_binary_version $NODE_VERSION "cumulus/polkadot-parachain/Cargo.toml"
reorder_prdocs $NODE_VERSION
reorder_prdocs $STABLE_BRANCH_NAME
git push origin "$STABLE_BRANCH_NAME"
2 changes: 1 addition & 1 deletion .github/workflows/release-reusable-rc-buid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.binary }}
package: polkadot-parachain
release_tag: ${{ inputs.release_tag }}
secrets:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/release-srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
sudo dpkg -i toml.deb
toml --version; jq --version
- name: Scan runtimes
- name: Scan and get runtimes list
id: get_runtimes_list
env:
EXCLUDED_RUNTIMES: ${{ inputs.excluded_runtimes }}:"substrate-test"
run: |
Expand All @@ -51,13 +52,6 @@ jobs:
MATRIX=$(find_runtimes | tee runtimes_list.json)
echo $MATRIX
- name: Get runtimes list
id: get_runtimes_list
run: |
ls -al
MATRIX=$(cat runtimes_list.json)
echo $MATRIX
echo "runtime=$MATRIX" >> $GITHUB_OUTPUT
srtool:
Expand Down
22 changes: 2 additions & 20 deletions scripts/release/build-changelogs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

export PRODUCT=polkadot
export VERSION=${VERSION:-1.5.0}
export VERSION=${VERSION:-stable2409}
export ENGINE=${ENGINE:-podman}
export REF1=${REF1:-'HEAD'}
export REF2=${REF2}
Expand Down Expand Up @@ -66,33 +66,21 @@ echo "Changelog ready in $OUTPUT/relnote_commits.md"
# Show the files
tree -s -h -c $OUTPUT/

ASSET_HUB_ROCOCO_DIGEST=${ASSET_HUB_ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/asset-hub-rococo-srtool-digest.json"}
ASSET_HUB_WESTEND_DIGEST=${ASSET_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/asset-hub-westend-srtool-digest.json"}
BRIDGE_HUB_ROCOCO_DIGEST=${BRIDGE_HUB_ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/bridge-hub-rococo-srtool-digest.json"}
BRIDGE_HUB_WESTEND_DIGEST=${BRIDGE_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/bridge-hub-westend-srtool-digest.json"}
COLLECTIVES_WESTEND_DIGEST=${COLLECTIVES_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/collectives-westend-srtool-digest.json"}
CONTRACTS_ROCOCO_DIGEST=${CONTRACTS_ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/contracts-rococo-srtool-digest.json"}
CORETIME_ROCOCO_DIGEST=${CORETIME_ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/coretime-rococo-srtool-digest.json"}
CORETIME_WESTEND_DIGEST=${CORETIME_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/coretime-westend-srtool-digest.json"}
GLUTTON_WESTEND_DIGEST=${GLUTTON_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/glutton-westend-srtool-digest.json"}
PEOPLE_ROCOCO_DIGEST=${PEOPLE_ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/people-rococo-srtool-digest.json"}
PEOPLE_WESTEND_DIGEST=${PEOPLE_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/people-westend-srtool-digest.json"}
ROCOCO_DIGEST=${ROCOCO_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/rococo-srtool-digest.json"}
WESTEND_DIGEST=${WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/westend-srtool-digest.json"}

jq \
--slurpfile srtool_asset_hub_rococo $ASSET_HUB_ROCOCO_DIGEST \
--slurpfile srtool_asset_hub_westend $ASSET_HUB_WESTEND_DIGEST \
--slurpfile srtool_bridge_hub_rococo $BRIDGE_HUB_ROCOCO_DIGEST \
--slurpfile srtool_bridge_hub_westend $BRIDGE_HUB_WESTEND_DIGEST \
--slurpfile srtool_collectives_westend $COLLECTIVES_WESTEND_DIGEST \
--slurpfile srtool_contracts_rococo $CONTRACTS_ROCOCO_DIGEST \
--slurpfile srtool_coretime_rococo $CORETIME_ROCOCO_DIGEST\
--slurpfile srtool_coretime_westend $CORETIME_WESTEND_DIGEST \
--slurpfile srtool_glutton_westend $GLUTTON_WESTEND_DIGEST \
--slurpfile srtool_people_rococ $PEOPLE_ROCOCO_DIGEST \
--slurpfile srtool_people_westend $PEOPLE_WESTEND_DIGEST \
--slurpfile srtool_rococo $ROCOCO_DIGEST \
--slurpfile srtool_westend $WESTEND_DIGEST \
-n '{
srtool: [
Expand All @@ -102,13 +90,7 @@ jq \
{ order: 13, name: "Westend Collectives", data: $srtool_collectives_westend[0] },
{ order: 14, name: "Westend Coretime", data: $srtool_coretime_westend[0] },
{ order: 15, name: "Westend Glutton", data: $srtool_glutton_westend[0] },
{ order: 16, name: "Westend People", data: $srtool_people_westend[0] },
{ order: 17, name: "Rococo", data: $srtool_rococo[0] },
{ order: 18, name: "Rococo AssetHub", data: $srtool_asset_hub_rococo[0] },
{ order: 19, name: "Rococo BridgeHub", data: $srtool_bridge_hub_rococo[0] },
{ order: 20, name: "Rococo Contracts", data: $srtool_contracts_rococo[0] },
{ order: 21, name: "Rococo Coretime", data: $srtool_coretime_rococo[0] },
{ order: 22, name: "Rococo People", data: $srtool_people_rococ[0] }
{ order: 16, name: "Westend People", data: $srtool_people_westend[0] }
] }' > "$PROJECT_ROOT/scripts/release/context.json"

RELEASE_DIR="$PROJECT_ROOT/scripts/release/"
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/templates/changelog.md.tera
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog for `{{ env.PRODUCT | capitalize }} v{{ env.VERSION }}`
## Changelog for `{{ env.PRODUCT | capitalize }} {{ env.VERSION }}`

{% for file in prdoc | sort(attribute="doc_filename.number") -%}
{%- set author= file.content.author | default(value="n/a") -%}
Expand Down

0 comments on commit 1cc760b

Please sign in to comment.