Skip to content

Commit c189651

Browse files
[stable2509] Backport #10379 (#10546)
Backport #10379 into `stable2509` 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 d786874 commit c189651

File tree

5 files changed

+85
-32
lines changed

5 files changed

+85
-32
lines changed

.github/workflows/release-22_combined-rc-runtime-builds-release-draft.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ on:
4747
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
4848
type: string
4949
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
5055

5156
jobs:
5257
check-synchronization:
@@ -73,6 +78,7 @@ jobs:
7378
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
7479
7580
build-runtimes-flow:
81+
if: ${{ inputs.no_runtimes == false }}
7682
needs: [validate-inputs]
7783
uses: "./.github/workflows/release-21_build-runtimes.yml"
7884
with:
@@ -97,11 +103,25 @@ jobs:
97103
attestations: write
98104
contents: read
99105

100-
trigger-release-draft:
106+
trigger-release-draft-with-runtimes:
107+
if: ${{ inputs.no_runtimes == false }}
101108
needs: [build-runtimes-flow, build-rc-flow, validate-inputs]
102109
uses: "./.github/workflows/release-30_publish_release_draft.yml"
103110
with:
104111
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
105112
build_run_id: ${{ github.run_id }}
106113
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
107127
secrets: inherit

.github/workflows/release-30_publish_release_draft.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@ on:
2020
required: true
2121
type: string
2222
runtimes:
23-
description: Runtimes to be published
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)
2431
required: true
32+
type: boolean
33+
default: false
2534
workflow_call:
2635
inputs:
2736
release_tag:
@@ -34,8 +43,17 @@ on:
3443
type: string
3544
runtimes:
3645
description: Runtimes to be published
37-
required: true
3846
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
3957

4058
jobs:
4159
check-synchronization:
@@ -85,6 +103,7 @@ jobs:
85103
repositories: polkadot-sdk
86104

87105
- name: Download runtimes artifacts
106+
if: ${{ inputs.no_runtimes == false && inputs.crates_only == false }}
88107
env:
89108
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
90109
run: |
@@ -110,6 +129,8 @@ jobs:
110129
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/people-westend-runtime/people-westend-srtool-digest.json
111130
WESTEND_DIGEST: ${{ github.workspace}}/runtimes/westend-runtime/westend-srtool-digest.json
112131
RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
132+
NO_RUNTIMES: ${{ inputs.no_runtimes }}
133+
CRATES_ONLY: ${{ inputs.crates_only }}
113134
shell: bash
114135
run: |
115136
. ./.github/scripts/common/lib.sh
@@ -155,6 +176,7 @@ jobs:
155176
--notes-file ${{ github.workspace}}/scripts/release/RELEASE_DRAFT.md
156177
157178
publish-runtimes:
179+
if: ${{ inputs.crates_only == false && inputs.no_runtimes == false }}
158180
needs: [ validate-inputs, publish-release-draft ]
159181
environment: release
160182
continue-on-error: true
@@ -206,6 +228,7 @@ jobs:
206228
--repo paritytech/polkadot-sdk "$VERSIONED_ASSET"
207229
208230
publish-release-artifacts:
231+
if: ${{ inputs.crates_only == false }}
209232
needs: [ validate-inputs, publish-release-draft ]
210233
environment: release
211234
continue-on-error: true
@@ -268,7 +291,7 @@ jobs:
268291
269292
post_to_matrix:
270293
runs-on: ubuntu-latest
271-
needs: [ validate-inputs, publish-release-draft, publish-runtimes, publish-release-artifacts ]
294+
needs: [ validate-inputs, publish-release-draft ]
272295
environment: release
273296
strategy:
274297
matrix:

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)