Skip to content

Commit 5021c6e

Browse files
[stable2506] Backport #10379 (#10545)
Backport #10379 into `stable2506` from EgorPopelyaev. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Egor_P <[email protected]>
1 parent 497ae55 commit 5021c6e

File tree

5 files changed

+227
-32
lines changed

5 files changed

+227
-32
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Release - Combined Builds Flow
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
chain:
7+
description: The chain to use for runtime builds
8+
default: all
9+
required: true
10+
type: choice
11+
options:
12+
- all
13+
- westend
14+
- asset-hub-westend
15+
- bridge-hub-westend
16+
- collectives-westend
17+
- coretime-westend
18+
- glutton-westend
19+
- people-westend
20+
runtime_dir:
21+
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
22+
default: polkadot/runtime/westend
23+
type: choice
24+
options:
25+
- polkadot/runtime/westend
26+
- cumulus/parachains/runtimes/assets/asset-hub-westend
27+
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend
28+
- cumulus/parachains/runtimes/collectives/collectives-westend
29+
- cumulus/parachains/runtimes/coretime/coretime-westend
30+
- cumulus/parachains/runtimes/people/people-westend
31+
- cumulus/parachains/runtimes/glutton/glutton-westend
32+
binary:
33+
description: Binary to be built for the release candidate
34+
default: all
35+
type: choice
36+
options:
37+
- polkadot
38+
- polkadot-parachain
39+
- polkadot-omni-node
40+
- frame-omni-bencher
41+
- chain-spec-builder
42+
- substrate-node
43+
- eth-rpc
44+
- subkey
45+
- all
46+
release_tag:
47+
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
48+
type: string
49+
required: true
50+
no_runtimes:
51+
description: If true, no runtime build will be triggered and release draft will be published without runtimes (⚠️ use it for the patch releases of the latest stable)
52+
required: true
53+
type: boolean
54+
default: false
55+
56+
jobs:
57+
check-synchronization:
58+
uses: paritytech-release/sync-workflows/.github/workflows/check-synchronization.yml@main
59+
secrets:
60+
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
61+
62+
validate-inputs:
63+
needs: [check-synchronization]
64+
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
65+
runs-on: ubuntu-latest
66+
outputs:
67+
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
68+
steps:
69+
- name: Checkout sources
70+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
71+
72+
- name: Validate inputs
73+
id: validate_inputs
74+
run: |
75+
. ./.github/scripts/common/lib.sh
76+
77+
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
78+
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
79+
80+
build-runtimes-flow:
81+
if: ${{ inputs.no_runtimes == false }}
82+
needs: [validate-inputs]
83+
uses: "./.github/workflows/release-21_build-runtimes.yml"
84+
with:
85+
chain: ${{ inputs.chain }}
86+
runtime_dir: ${{ inputs.runtime_dir }}
87+
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
88+
secrets: inherit
89+
permissions:
90+
id-token: write
91+
attestations: write
92+
contents: read
93+
94+
build-rc-flow:
95+
needs: [validate-inputs]
96+
uses: "./.github/workflows/release-20_build-rc.yml"
97+
with:
98+
binary: ${{ inputs.binary }}
99+
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
100+
secrets: inherit
101+
permissions:
102+
id-token: write
103+
attestations: write
104+
contents: read
105+
106+
trigger-release-draft-with-runtimes:
107+
if: ${{ inputs.no_runtimes == false }}
108+
needs: [build-runtimes-flow, build-rc-flow, validate-inputs]
109+
uses: "./.github/workflows/release-30_publish_release_draft.yml"
110+
with:
111+
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
112+
build_run_id: ${{ github.run_id }}
113+
runtimes: '${{ needs.build-runtimes-flow.outputs.published_runtimes }}'
114+
no_runtimes: ${{ inputs.no_runtimes }}
115+
crates_only: false
116+
secrets: inherit
117+
118+
trigger-release-draft-without-runtimes:
119+
if: ${{ inputs.no_runtimes == true }}
120+
needs: [build-rc-flow, validate-inputs]
121+
uses: "./.github/workflows/release-30_publish_release_draft.yml"
122+
with:
123+
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
124+
build_run_id: ${{ github.run_id }}
125+
no_runtimes: ${{ inputs.no_runtimes }}
126+
crates_only: false
127+
secrets: inherit

.github/workflows/release-30_publish_release_draft.yml

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,45 @@ on:
1515
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcX or polkadot-stableYYMM(-X)
1616
required: true
1717
type: string
18+
build_run_id:
19+
description: Run ID of the current release workflow run to be used to download the artifacts
20+
required: true
21+
type: string
22+
runtimes:
23+
description: Runtimes to be published (⚠️ this needs to be provided in case of the complete release, for the crates only release or a patch release without runtimes it is not needed)
24+
no_runtimes:
25+
description: If true, release draft will be published without runtimes
26+
required: true
27+
type: boolean
28+
default: false
29+
crates_only:
30+
description: If true, release draft will contain only release notes and no artifacts will be published (needed for stable releases that are crates only)
31+
required: true
32+
type: boolean
33+
default: false
34+
workflow_call:
35+
inputs:
36+
release_tag:
37+
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
38+
required: true
39+
type: string
40+
build_run_id:
41+
description: Run ID of the current release workflow run to be used to download the artifacts
42+
required: true
43+
type: string
44+
runtimes:
45+
description: Runtimes to be published
46+
type: string
47+
no_runtimes:
48+
description: If true, release draft will be published without runtimes
49+
required: true
50+
type: boolean
51+
default: false
52+
crates_only:
53+
description: If true, release draft will contain only release notes and no artifacts will be published (needed for stable releases that are crates only)
54+
required: true
55+
type: boolean
56+
default: false
1857

1958
jobs:
2059
check-synchronization:
@@ -63,10 +102,25 @@ jobs:
63102

64103
steps:
65104
- name: Checkout
66-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
67106

68-
- name: Download artifacts
69-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
107+
- name: Generate content write token for the release automation
108+
id: generate_write_token
109+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
110+
with:
111+
app-id: ${{ vars.POLKADOT_SDK_RELEASE_RW_APP_ID }}
112+
private-key: ${{ secrets.POLKADOT_SDK_RELEASE_RW_APP_KEY }}
113+
owner: paritytech
114+
repositories: polkadot-sdk
115+
116+
- name: Download runtimes artifacts
117+
if: ${{ inputs.no_runtimes == false && inputs.crates_only == false }}
118+
env:
119+
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
120+
run: |
121+
mkdir -p ${{ github.workspace}}/runtimes/
122+
gh run download ${{ inputs.build_run_id }} --dir ${{ github.workspace}}/runtimes
123+
ls -la ${{ github.workspace}}/runtimes
70124
71125
- name: Prepare tooling
72126
run: |
@@ -86,6 +140,8 @@ jobs:
86140
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json
87141
WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json
88142
RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
143+
NO_RUNTIMES: ${{ inputs.no_runtimes }}
144+
CRATES_ONLY: ${{ inputs.crates_only }}
89145
shell: bash
90146
run: |
91147
. ./.github/scripts/common/lib.sh
@@ -140,7 +196,8 @@ jobs:
140196
--notes-file ${{ github.workspace}}/scripts/release/RELEASE_DRAFT.md
141197
142198
publish-runtimes:
143-
needs: [ validate-inputs, build-runtimes, publish-release-draft ]
199+
if: ${{ inputs.crates_only == false && inputs.no_runtimes == false }}
200+
needs: [ validate-inputs, publish-release-draft ]
144201
environment: release
145202
continue-on-error: true
146203
runs-on: ubuntu-latest
@@ -181,6 +238,7 @@ jobs:
181238
--repo paritytech/polkadot-sdk "$VERSIONED_ASSET"
182239
183240
publish-release-artifacts:
241+
if: ${{ inputs.crates_only == false }}
184242
needs: [ validate-inputs, publish-release-draft ]
185243
environment: release
186244
continue-on-error: true

scripts/release/build-changelogs.sh

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export ENGINE=${ENGINE:-podman}
66
export REF1=${REF1:-'HEAD'}
77
export REF2=${REF2}
88
export RUSTC_STABLE=${RUSTC_STABLE:-'1.0'}
9+
export NO_RUNTIMES=${NO_RUNTIMES:-'false'}
10+
export CRATES_ONLY=${CRATES_ONLY:-'false'}
911

1012
PROJECT_ROOT=`git rev-parse --show-toplevel`
1113
echo $PROJECT_ROOT
@@ -66,32 +68,36 @@ echo "Changelog ready in $OUTPUT/relnote_commits.md"
6668
# Show the files
6769
tree -s -h -c $OUTPUT/
6870

69-
ASSET_HUB_WESTEND_DIGEST=${ASSET_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/asset-hub-westend-srtool-digest.json"}
70-
BRIDGE_HUB_WESTEND_DIGEST=${BRIDGE_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/bridge-hub-westend-srtool-digest.json"}
71-
COLLECTIVES_WESTEND_DIGEST=${COLLECTIVES_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/collectives-westend-srtool-digest.json"}
72-
CORETIME_WESTEND_DIGEST=${CORETIME_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/coretime-westend-srtool-digest.json"}
73-
GLUTTON_WESTEND_DIGEST=${GLUTTON_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/glutton-westend-srtool-digest.json"}
74-
PEOPLE_WESTEND_DIGEST=${PEOPLE_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/people-westend-srtool-digest.json"}
75-
WESTEND_DIGEST=${WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/westend-srtool-digest.json"}
76-
77-
jq \
78-
--slurpfile srtool_asset_hub_westend $ASSET_HUB_WESTEND_DIGEST \
79-
--slurpfile srtool_bridge_hub_westend $BRIDGE_HUB_WESTEND_DIGEST \
80-
--slurpfile srtool_collectives_westend $COLLECTIVES_WESTEND_DIGEST \
81-
--slurpfile srtool_coretime_westend $CORETIME_WESTEND_DIGEST \
82-
--slurpfile srtool_glutton_westend $GLUTTON_WESTEND_DIGEST \
83-
--slurpfile srtool_people_westend $PEOPLE_WESTEND_DIGEST \
84-
--slurpfile srtool_westend $WESTEND_DIGEST \
85-
-n '{
86-
srtool: [
87-
{ order: 10, name: "Westend", data: $srtool_westend[0] },
88-
{ order: 11, name: "Westend AssetHub", data: $srtool_asset_hub_westend[0] },
89-
{ order: 12, name: "Westend BridgeHub", data: $srtool_bridge_hub_westend[0] },
90-
{ order: 13, name: "Westend Collectives", data: $srtool_collectives_westend[0] },
91-
{ order: 14, name: "Westend Coretime", data: $srtool_coretime_westend[0] },
92-
{ order: 15, name: "Westend Glutton", data: $srtool_glutton_westend[0] },
93-
{ order: 16, name: "Westend People", data: $srtool_people_westend[0] }
94-
] }' > "$PROJECT_ROOT/scripts/release/context.json"
71+
if [[ "$NO_RUNTIMES" == "false" && "$CRATES_ONLY" == "false" ]]; then
72+
ASSET_HUB_WESTEND_DIGEST=${ASSET_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/asset-hub-westend-srtool-digest.json"}
73+
BRIDGE_HUB_WESTEND_DIGEST=${BRIDGE_HUB_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/bridge-hub-westend-srtool-digest.json"}
74+
COLLECTIVES_WESTEND_DIGEST=${COLLECTIVES_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/collectives-westend-srtool-digest.json"}
75+
CORETIME_WESTEND_DIGEST=${CORETIME_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/coretime-westend-srtool-digest.json"}
76+
GLUTTON_WESTEND_DIGEST=${GLUTTON_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/glutton-westend-srtool-digest.json"}
77+
PEOPLE_WESTEND_DIGEST=${PEOPLE_WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/people-westend-srtool-digest.json"}
78+
WESTEND_DIGEST=${WESTEND_DIGEST:-"$PROJECT_ROOT/scripts/release/digests/westend-srtool-digest.json"}
79+
80+
jq \
81+
--slurpfile srtool_asset_hub_westend $ASSET_HUB_WESTEND_DIGEST \
82+
--slurpfile srtool_bridge_hub_westend $BRIDGE_HUB_WESTEND_DIGEST \
83+
--slurpfile srtool_collectives_westend $COLLECTIVES_WESTEND_DIGEST \
84+
--slurpfile srtool_coretime_westend $CORETIME_WESTEND_DIGEST \
85+
--slurpfile srtool_glutton_westend $GLUTTON_WESTEND_DIGEST \
86+
--slurpfile srtool_people_westend $PEOPLE_WESTEND_DIGEST \
87+
--slurpfile srtool_westend $WESTEND_DIGEST \
88+
-n '{
89+
srtool: [
90+
{ order: 10, name: "Westend", data: $srtool_westend[0] },
91+
{ order: 11, name: "Westend AssetHub", data: $srtool_asset_hub_westend[0] },
92+
{ order: 12, name: "Westend BridgeHub", data: $srtool_bridge_hub_westend[0] },
93+
{ order: 13, name: "Westend Collectives", data: $srtool_collectives_westend[0] },
94+
{ order: 14, name: "Westend Coretime", data: $srtool_coretime_westend[0] },
95+
{ order: 15, name: "Westend Glutton", data: $srtool_glutton_westend[0] },
96+
{ order: 16, name: "Westend People", data: $srtool_people_westend[0] }
97+
] }' > "$PROJECT_ROOT/scripts/release/context.json"
98+
else
99+
echo '{}' > "$PROJECT_ROOT/scripts/release/context.json"
100+
fi
95101

96102
RELEASE_DIR="$PROJECT_ROOT/scripts/release/"
97103
pushd $RELEASE_DIR >/dev/null

scripts/release/templates/docker_image.md.tera

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ The docker images for the `polkadot` node binary and the `polkadot-parachain` bi
99
You may also pull it with:
1010

1111
```
12-
docker pull parity/polkadot:latest
12+
docker pull parity/polkadot:{{ env.VERSION }}
1313
```
1414

1515
or
1616

1717
```
18-
docker pull parity/polkadot-parachain:latest
18+
docker pull parity/polkadot-parachain:{{ env.VERSION }}
1919
```

scripts/release/templates/template.md.tera

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ This release contains the changes from `{{ env.REF1 | replace(from="refs/tags/",
1515

1616
{% include "compiler.md.tera" -%}
1717

18+
{% if env.NO_RUNTIMES == "false" and env.CRATES_ONLY == "false" -%}
1819
{% include "runtimes.md.tera" -%}
20+
{% endif -%}
1921

22+
{% if env.CRATES_ONLY == "false" -%}
2023
{% include "docker_image.md.tera" -%}
24+
{% endif -%}

0 commit comments

Comments
 (0)