Skip to content

Commit fdf3d65

Browse files
[Release|CI/CD] Combine branch-off and RC automation flows (#8754)
This PR combines two release flows that are responsible for the first steps in the release process: Branch-off a stable branch and Create RC tag flows. Both actions now can be done from one flow by choosing a needed option in the triggering form: <img width="316" alt="Screenshot 2025-06-05 at 11 30 09" src="https://github.com/user-attachments/assets/767bc351-918f-41e9-af42-f94a20036a50" /> The tagging can be done as part of branch off directly or as an independent action as usually there are some other release activities (like crates release) done after the branch is created. Closes: paritytech/devops#3825
1 parent 9c9e3f1 commit fdf3d65

4 files changed

Lines changed: 86 additions & 30 deletions

File tree

.github/workflows/release-10_branchoff-stable.yml

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
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

36
on:
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

1527
jobs:
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:
@@ -44,7 +59,7 @@ jobs:
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
@@ -54,7 +69,7 @@ jobs:
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 }}
@@ -91,7 +106,7 @@ jobs:
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 }}

.github/workflows/release-11_rc-automation.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
name: Release - RC automation
1+
name: Release - RC tagging automation
22
on:
3-
# TODO: Activate it and delete old branches patterns, when the release process from stable is settled
4-
#push:
5-
# branches:
6-
# # Catches release-polkadot-v1.2.3, release-v1.2.3-rc1, etc
7-
# - release-v[0-9]+.[0-9]+.[0-9]+*
8-
# - release-cumulus-v[0-9]+*
9-
# - release-polkadot-v[0-9]+*
10-
# - stable
11-
123
workflow_dispatch:
134
inputs:
145
version:
156
description: Current release/rc version in format polkadot-stableYYMM
7+
workflow_call:
8+
inputs:
9+
version:
10+
description: Current release/rc version in format polkadot-stableYYMM
11+
type: string
12+
secrets:
13+
PGP_KMS_SIGN_COMMITS_KEY:
14+
required: true
15+
PGP_KMS_HASH:
16+
required: true
17+
AWS_ACCESS_KEY_ID:
18+
required: true
19+
AWS_SECRET_ACCESS_KEY:
20+
required: true
21+
AWS_DEFAULT_REGION:
22+
required: true
23+
RELEASE_AUTOMATION_APP_PRIVATE_KEY:
24+
required: true
25+
RELEASENOTES_MATRIX_V2_ACCESS_TOKEN:
26+
required: true
1627

1728
jobs:
1829
tag_rc:
@@ -38,7 +49,7 @@ jobs:
3849
3950
- name: Generate content write token for the release automation
4051
id: generate_write_token
41-
uses: actions/create-github-app-token@v1
52+
uses: actions/create-github-app-token@v2
4253
with:
4354
app-id: ${{ vars.RELEASE_AUTOMATION_APP_ID }}
4455
private-key: ${{ secrets.RELEASE_AUTOMATION_APP_PRIVATE_KEY }}

docs/BACKPORT.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Backports should only be used to fix bugs or security issues - never to introduc
1414
3. Merge the PR into `master`.
1515
4. Wait for the bot to open the backport PR.
1616
5. Ensure the change is audited or does not need audit.
17-
6. Merge the backport PR.
17+
6. Merge the backport PR.(ℹ️ for the branches starting from 2412 it can be done automatically
18+
if backport PR has at least two reviews and a pipeline is green)
1819

1920
The label can also be added after the PR is merged.
2021

docs/RELEASE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,20 @@ utilizes [`cargo-semver-checks`](https://github.com/obi1kenobi/cargo-semver-chec
141141

142142
Cadence: every 3 months for new `stable` releases and monthly for existing `stables`. Responsible: Release Team.
143143

144-
### Steps to execute a new stable release
144+
### Steps to execute a new stable binary release
145145

146146
From the main Polkadot-sdk repository in the paritytech org:
147147

148148
1. On the cut-off date, create a new branch with the name `satbleYYMM`
149-
using [Branch-off stable flow](/.github/workflows/release-10_branchoff-stable.yml)
150-
2. Create a new rc tag from the stable branch using [RC Automation flow](/.github/workflows/release-11_rc-automation.yml)
149+
using combined [Branch-off stable/tag rc flow](/.github/workflows/release-10_branchoff-stable.yml)
150+
2. Create a new rc tag from the stable branch using combined
151+
[Branch-off stable/tag rc flow](/.github/workflows/release-10_branchoff-stable.yml)
152+
153+
ℹ️ These first two steps can be done all in one if there are no extra actions (like crates release) are needed
154+
to be done in between.
155+
In case of a crates release: when it is done, the changes done by the Parity-Publish needs to be revereted and
156+
merged back to the stable branch via a PR as the direct pushes are restricted. When this is done,
157+
the new RC tag can be created using the flow from above.
151158

152159
From the forked Polkadot-sdk repository in the [paritytech-release org](https://github.com/paritytech-release/polkadot-sdk/actions):
153160

0 commit comments

Comments
 (0)