1- name : Release - Branch off stable branch
1+ # This workflow has combined functionality of branching-off a new stable release branch and tagging an RC.
2+ # The options to branch-off and/or tag an RC can be chosen independently by ticking the appropriate checkbox in the launching form,
3+ # as the branch-off happens only ones per quarter and a tagging activity done more frequently for each new RC during the release process.
4+ name : Release - Branch off stable branch and/or tag rc
25
36on :
47 workflow_dispatch :
58 inputs :
69 stable_version :
7- description : New stable version in the format stableYYMM
10+ description : Stable version in the format stableYYMM that will be used as branch name and rc tag base
811 required : true
912 type : string
1013
1114 node_version :
12- description : Version of the polkadot node in the format X.XX.X (e.g. 1.15.0)
13- required : true
15+ description : Version of the polkadot node in the format X.XX.X (e.g. 1.15.0). ℹ️ Node version is needed only for the branch-off
16+ type : string
17+ required : false
18+
19+ is_new_stable :
20+ description : Check this box if this is a new stable release and the stable branch needs to be created
21+ type : boolean
22+
23+ tag_rc :
24+ description : Check this box if the rc tag needs to be created
25+ type : boolean
1426
1527jobs :
16- prepare-tooling :
28+ validate-inputs :
1729 runs-on : ubuntu-latest
1830 outputs :
1931 node_version : ${{ steps.validate_inputs.outputs.node_version }}
@@ -28,14 +40,17 @@ jobs:
2840 run : |
2941 . ./.github/scripts/common/lib.sh
3042
31- node_version=$(filter_version_from_input "${{ inputs.node_version }}")
32- echo "node_version=${node_version}" >> $GITHUB_OUTPUT
43+ if [ -n "${{ inputs.node_version }}" ]; then
44+ node_version=$(filter_version_from_input "${{ inputs.node_version }}")
45+ echo "node_version=${node_version}" >> $GITHUB_OUTPUT
46+ fi
3347
3448 stable_version=$(validate_stable_tag ${{ inputs.stable_version }})
3549 echo "stable_version=${stable_version}" >> $GITHUB_OUTPUT
3650
3751 create-stable-branch :
38- needs : [prepare-tooling]
52+ if : ${{ inputs.is_new_stable }}
53+ needs : [ validate-inputs ]
3954 runs-on : ubuntu-latest
4055 environment : release
4156 env :
4459 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
4560 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4661 AWS_DEFAULT_REGION : ${{ secrets.AWS_DEFAULT_REGION }}
47- STABLE_BRANCH_NAME : ${{ needs.prepare-tooling .outputs.stable_version }}
62+ STABLE_BRANCH_NAME : ${{ needs.validate-inputs .outputs.stable_version }}
4863
4964 steps :
5065 - name : Install pgpkkms
5469
5570 - name : Generate content write token for the release automation
5671 id : generate_write_token
57- uses : actions/create-github-app-token@v1
72+ uses : actions/create-github-app-token@v2
5873 with :
5974 app-id : ${{ vars.RELEASE_AUTOMATION_APP_ID }}
6075 private-key : ${{ secrets.RELEASE_AUTOMATION_APP_PRIVATE_KEY }}
91106 run : |
92107 . ./.github/scripts/release/release_lib.sh
93108
94- NODE_VERSION="${{ needs.prepare-tooling .outputs.node_version }}"
109+ NODE_VERSION="${{ needs.validate-inputs .outputs.node_version }}"
95110 NODE_VERSION_PATTERN="\(NODE_VERSION[^=]*= \)\".*\""
96111 set_version "$NODE_VERSION_PATTERN" $NODE_VERSION "polkadot/node/primitives/src/lib.rs"
97112 commit_with_message "Bump node version to $NODE_VERSION in polkadot-cli"
@@ -102,12 +117,34 @@ jobs:
102117 runtimes_list=$(get_filtered_runtimes_list)
103118 set_spec_versions $SPEC_VERSION "${runtimes_list[@]}"
104119
105- # TODO: clarify what to do with the polkadot-parachain binary
106- # Set new version for polkadot-parachain binary to match the polkadot node binary
107- # set_polkadot_parachain_binary_version $NODE_VERSION "cumulus/polkadot-parachain/Cargo.toml"
108-
109120 reorder_prdocs $STABLE_BRANCH_NAME
110121
111122 gh auth setup-git
112123
113124 git push origin "$STABLE_BRANCH_NAME"
125+
126+ - name : Tag RC after branch off
127+ if : ${{ inputs.tag_rc }}
128+ env :
129+ GH_TOKEN : ${{ steps.generate_write_token.outputs.token }} # or use a PAT with workflow scope
130+ run : |
131+ stable_tag_base=polkadot-${{ needs.validate-inputs.outputs.stable_version }}
132+ gh workflow run release-11_rc-automation.yml \
133+ --repo ${{ github.repository }} \
134+ --ref ${{ needs.validate-inputs.outputs.stable_version }} \
135+ --field version=${stable_tag_base}
136+
137+ tag-rc-without-branchoff :
138+ if : ${{ !inputs.is_new_stable && inputs.tag_rc }}
139+ needs : [ validate-inputs ]
140+ uses : ./.github/workflows/release-11_rc-automation.yml
141+ with :
142+ version : polkadot-${{ needs.validate-inputs.outputs.stable_version }}
143+ secrets :
144+ PGP_KMS_SIGN_COMMITS_KEY : ${{ secrets.PGP_KMS_SIGN_COMMITS_KEY }}
145+ PGP_KMS_HASH : ${{ secrets.PGP_KMS_HASH }}
146+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
147+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
148+ AWS_DEFAULT_REGION : ${{ secrets.AWS_DEFAULT_REGION }}
149+ RELEASE_AUTOMATION_APP_PRIVATE_KEY : ${{ secrets.RELEASE_AUTOMATION_APP_PRIVATE_KEY }}
150+ RELEASENOTES_MATRIX_V2_ACCESS_TOKEN : ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
0 commit comments