Skip to content

Commit fcc861e

Browse files
EgorPopelyaevgithub-actions[bot]
authored andcommitted
BACKPORT-CONFLICT
1 parent 497ae55 commit fcc861e

5 files changed

Lines changed: 235 additions & 28 deletions

File tree

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: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,48 @@ 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+
<<<<<<< HEAD
19+
=======
20+
build_run_id:
21+
description: Run ID of the current release workflow run to be used to download the artifacts
22+
required: true
23+
type: string
24+
runtimes:
25+
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)
26+
no_runtimes:
27+
description: If true, release draft will be published without runtimes
28+
required: true
29+
type: boolean
30+
default: false
31+
crates_only:
32+
description: If true, release draft will contain only release notes and no artifacts will be published (needed for stable releases that are crates only)
33+
required: true
34+
type: boolean
35+
default: false
36+
workflow_call:
37+
inputs:
38+
release_tag:
39+
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
40+
required: true
41+
type: string
42+
build_run_id:
43+
description: Run ID of the current release workflow run to be used to download the artifacts
44+
required: true
45+
type: string
46+
runtimes:
47+
description: Runtimes to be published
48+
type: string
49+
no_runtimes:
50+
description: If true, release draft will be published without runtimes
51+
required: true
52+
type: boolean
53+
default: false
54+
crates_only:
55+
description: If true, release draft will contain only release notes and no artifacts will be published (needed for stable releases that are crates only)
56+
required: true
57+
type: boolean
58+
default: false
59+
>>>>>>> 822943a1 ([Release|CI/CD] Create draft release without runtimes or any artefacts attached (for crates only releases) (#10379))
1860

1961
jobs:
2062
check-synchronization:
@@ -65,8 +107,28 @@ jobs:
65107
- name: Checkout
66108
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67109

110+
<<<<<<< HEAD
68111
- name: Download artifacts
69112
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
113+
=======
114+
- name: Generate content write token for the release automation
115+
id: generate_write_token
116+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
117+
with:
118+
app-id: ${{ vars.POLKADOT_SDK_RELEASE_RW_APP_ID }}
119+
private-key: ${{ secrets.POLKADOT_SDK_RELEASE_RW_APP_KEY }}
120+
owner: paritytech
121+
repositories: polkadot-sdk
122+
123+
- name: Download runtimes artifacts
124+
if: ${{ inputs.no_runtimes == false && inputs.crates_only == false }}
125+
env:
126+
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
127+
run: |
128+
mkdir -p ${{ github.workspace}}/runtimes/
129+
gh run download ${{ inputs.build_run_id }} --dir ${{ github.workspace}}/runtimes
130+
ls -la ${{ github.workspace}}/runtimes
131+
>>>>>>> 822943a1 ([Release|CI/CD] Create draft release without runtimes or any artefacts attached (for crates only releases) (#10379))
70132

71133
- name: Prepare tooling
72134
run: |
@@ -86,6 +148,8 @@ jobs:
86148
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json
87149
WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json
88150
RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
151+
NO_RUNTIMES: ${{ inputs.no_runtimes }}
152+
CRATES_ONLY: ${{ inputs.crates_only }}
89153
shell: bash
90154
run: |
91155
. ./.github/scripts/common/lib.sh
@@ -140,7 +204,12 @@ jobs:
140204
--notes-file ${{ github.workspace}}/scripts/release/RELEASE_DRAFT.md
141205
142206
publish-runtimes:
207+
<<<<<<< HEAD
143208
needs: [ validate-inputs, build-runtimes, publish-release-draft ]
209+
=======
210+
if: ${{ inputs.crates_only == false && inputs.no_runtimes == false }}
211+
needs: [ validate-inputs, publish-release-draft ]
212+
>>>>>>> 822943a1 ([Release|CI/CD] Create draft release without runtimes or any artefacts attached (for crates only releases) (#10379))
144213
environment: release
145214
continue-on-error: true
146215
runs-on: ubuntu-latest
@@ -181,6 +250,7 @@ jobs:
181250
--repo paritytech/polkadot-sdk "$VERSIONED_ASSET"
182251
183252
publish-release-artifacts:
253+
if: ${{ inputs.crates_only == false }}
184254
needs: [ validate-inputs, publish-release-draft ]
185255
environment: release
186256
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)