From 7ce3f69789965727b1a8cd650310f8f0eabec3f0 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 8 Oct 2024 15:56:35 +0200 Subject: [PATCH 1/6] replace use of the old version pattern with the new --- .github/scripts/common/lib.sh | 2 +- .github/workflows/release-10_rc-automation.yml | 4 ++-- .github/workflows/release-branchoff-stable.yml | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/scripts/common/lib.sh b/.github/scripts/common/lib.sh index d2a4baf12fa7..e8f8aef007d9 100755 --- a/.github/scripts/common/lib.sh +++ b/.github/scripts/common/lib.sh @@ -462,7 +462,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 diff --git a/.github/workflows/release-10_rc-automation.yml b/.github/workflows/release-10_rc-automation.yml index 195c14dbd5ab..41783f6cc721 100644 --- a/.github/workflows/release-10_rc-automation.yml +++ b/.github/workflows/release-10_rc-automation.yml @@ -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: @@ -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 diff --git a/.github/workflows/release-branchoff-stable.yml b/.github/workflows/release-branchoff-stable.yml index c4c50f5398e8..bd3d086df1dc 100644 --- a/.github/workflows/release-branchoff-stable.yml +++ b/.github/workflows/release-branchoff-stable.yml @@ -15,10 +15,12 @@ on: 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 + # 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 }} @@ -40,9 +42,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: @@ -97,9 +97,9 @@ jobs: set_spec_versions $SPEC_VERSION "${runtimes_list[@]}" # TODO: clarify what to do with the polkadot-parachain binary - # 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" + 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" From 04bb21faaa612458f85bd4e542564cbb8286ffdc Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 11 Oct 2024 14:03:30 +0200 Subject: [PATCH 2/6] simplify tags assignment --- .github/workflows/release-50_publish-docker.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-50_publish-docker.yml b/.github/workflows/release-50_publish-docker.yml index dacfcc5995b7..1fe68441a62f 100644 --- a/.github/workflows/release-50_publish-docker.yml +++ b/.github/workflows/release-50_publish-docker.yml @@ -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 From b2727d4e5d218779201c89fabeb73beb9a544e87 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 11 Oct 2024 15:29:24 +0200 Subject: [PATCH 3/6] adjust filter version function --- .github/scripts/common/lib.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/scripts/common/lib.sh b/.github/scripts/common/lib.sh index e8f8aef007d9..22b5b07a7f5b 100755 --- a/.github/scripts/common/lib.sh +++ b/.github/scripts/common/lib.sh @@ -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 From a3d800015ac8ffec837f5909ab2ce062283cd1a3 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 11 Oct 2024 15:35:04 +0200 Subject: [PATCH 4/6] fix typo --- .github/workflows/release-branchoff-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-branchoff-stable.yml b/.github/workflows/release-branchoff-stable.yml index bd3d086df1dc..720d693e274c 100644 --- a/.github/workflows/release-branchoff-stable.yml +++ b/.github/workflows/release-branchoff-stable.yml @@ -97,7 +97,7 @@ jobs: set_spec_versions $SPEC_VERSION "${runtimes_list[@]}" # TODO: clarify what to do with the polkadot-parachain binary - Set new version for polkadot-parachain binary to match the polkadot node binary + # 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 $STABLE_BRANCH_NAME From 2fccec7e5a5a91be39d004f0cbb9aa95a1897869 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 11 Oct 2024 15:41:06 +0200 Subject: [PATCH 5/6] fix node version number input --- .github/scripts/common/lib.sh | 2 +- .github/workflows/release-branchoff-stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/common/lib.sh b/.github/scripts/common/lib.sh index 22b5b07a7f5b..56d0371d678e 100755 --- a/.github/scripts/common/lib.sh +++ b/.github/scripts/common/lib.sh @@ -405,7 +405,7 @@ function find_runtimes() { # output: none filter_version_from_input() { version=$1 - regex="^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 echo $version diff --git a/.github/workflows/release-branchoff-stable.yml b/.github/workflows/release-branchoff-stable.yml index 720d693e274c..c7556079947a 100644 --- a/.github/workflows/release-branchoff-stable.yml +++ b/.github/workflows/release-branchoff-stable.yml @@ -9,7 +9,7 @@ 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: From fd7393604da3bed6a01473bb00e89d7b7e8b4546 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 11 Oct 2024 15:45:19 +0200 Subject: [PATCH 6/6] test --- .github/workflows/release-branchoff-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-branchoff-stable.yml b/.github/workflows/release-branchoff-stable.yml index c7556079947a..ed6c4ea69621 100644 --- a/.github/workflows/release-branchoff-stable.yml +++ b/.github/workflows/release-branchoff-stable.yml @@ -98,7 +98,7 @@ jobs: # TODO: clarify what to do with the polkadot-parachain binary # 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" + # set_polkadot_parachain_binary_version $NODE_VERSION "cumulus/polkadot-parachain/Cargo.toml" reorder_prdocs $STABLE_BRANCH_NAME