Skip to content

Commit ca68872

Browse files
BDevParitygithub-actions[bot]
authored andcommitted
BACKPORT-CONFLICT
1 parent d173a5f commit ca68872

12 files changed

+639
-45
lines changed

.github/scripts/release/release_lib.sh

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ commit_with_message() {
2929
# input: none
3030
# output: list of filtered runtimes
3131
get_filtered_runtimes_list() {
32-
grep_filters=("runtime.*" "test|template|starters|substrate")
32+
grep_filters=("runtime.*" "test|template|starters|substrate|docs")
3333

3434
git grep spec_version: | grep .rs: | grep -e "${grep_filters[0]}" | grep "lib.rs" | grep -vE "${grep_filters[1]}" | cut -d: -f1
3535
}
@@ -91,13 +91,20 @@ function get_spec_version() {
9191
reorder_prdocs() {
9292
VERSION="$1"
9393

94-
printf "[+] ℹ️ Reordering prdocs:"
94+
printf "[+] ℹ️ Reordering prdocs:\n"
9595

9696
VERSION=$(sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/' <<< "$VERSION") #getting reed of the 'v' prefix
97-
mkdir -p "prdoc/$VERSION"
98-
mv prdoc/pr_*.prdoc prdoc/$VERSION
99-
git add -A
100-
commit_with_message "Reordering prdocs for the release $VERSION"
97+
98+
# Check if there are any prdoc files to move
99+
if ls prdoc/pr_*.prdoc 1> /dev/null 2>&1; then
100+
mkdir -p "prdoc/$VERSION"
101+
mv prdoc/pr_*.prdoc prdoc/$VERSION
102+
git add -A
103+
commit_with_message "Reordering prdocs for the release $VERSION"
104+
echo "✅ Successfully reordered prdocs"
105+
else
106+
echo "⚠️ No prdoc files found to reorder"
107+
fi
101108
}
102109

103110
# Bump the binary version of the polkadot-parachain binary with the
@@ -195,3 +202,50 @@ function get_s3_url_base() {
195202
;;
196203
esac
197204
}
205+
206+
# Bump spec_version in a runtime file based on release type
207+
# For patch release: bump last 3 digits (patch part) by 1
208+
# For new stable release: bump middle part (minor) by 1, reset patch to 0
209+
#
210+
# input:
211+
# - file: path to the runtime file
212+
# - is_patch_release: "true" for patch release, "false" for new stable
213+
# output: prints the new spec_version, modifies file in place
214+
bump_spec_version() {
215+
local file=$1
216+
local is_patch_release=$2
217+
218+
# Extract current spec_version from file (format: X_YYY_ZZZ)
219+
local current_spec=$(grep -oP 'spec_version:\s*\K[0-9]+_[0-9]+_[0-9]+' "$file" | head -1)
220+
221+
if [ -z "$current_spec" ]; then
222+
echo "⚠️ Warning: Could not find spec_version in $file"
223+
return 1
224+
fi
225+
226+
# Parse the spec_version (format: X_YYY_ZZZ)
227+
local major=$(echo "$current_spec" | cut -d'_' -f1)
228+
local minor=$(echo "$current_spec" | cut -d'_' -f2)
229+
local patch=$(echo "$current_spec" | cut -d'_' -f3)
230+
231+
# Remove leading zeros for arithmetic
232+
minor=$((10#$minor))
233+
patch=$((10#$patch))
234+
235+
if [ "$is_patch_release" = "true" ]; then
236+
# Patch release: bump patch part by 1
237+
patch=$((patch + 1))
238+
else
239+
# New stable release: bump minor by 1, reset patch to 0
240+
minor=$((minor + 1))
241+
patch=0
242+
fi
243+
244+
# Format back to X_YYY_ZZZ format (with proper zero padding)
245+
local new_spec=$(printf "%d_%03d_%03d" "$major" "$minor" "$patch")
246+
247+
# Replace in file
248+
sed -ri "s/spec_version: ${current_spec},/spec_version: ${new_spec},/" "$file"
249+
250+
echo "$new_spec"
251+
}

.github/workflows/release-20_build-rc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
validate-inputs:
2929
needs: [check-synchronization]
30-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
30+
if: needs.check-synchronization.outputs.checks_passed == 'true'
3131
runs-on: ubuntu-latest
3232
outputs:
3333
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release - Build runtimes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
chain:
7+
description: The chain to use
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+
33+
release_tag:
34+
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
35+
type: string
36+
37+
workflow_call:
38+
inputs:
39+
chain:
40+
description: The chain to use
41+
default: all
42+
required: true
43+
type: string
44+
runtime_dir:
45+
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)
46+
default: polkadot/runtime/westend
47+
type: string
48+
release_tag:
49+
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcY or polkadot-stableYYMM(-X)
50+
type: string
51+
outputs:
52+
published_runtimes:
53+
value: ${{ jobs.build-runtimes.outputs.published_runtimes }}
54+
55+
jobs:
56+
check-synchronization:
57+
uses: paritytech-release/sync-workflows/.github/workflows/check-synchronization.yml@main
58+
secrets:
59+
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
60+
61+
validate-inputs:
62+
needs: [check-synchronization]
63+
if: needs.check-synchronization.outputs.checks_passed == 'true'
64+
runs-on: ubuntu-latest
65+
outputs:
66+
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
67+
steps:
68+
- name: Checkout sources
69+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
70+
71+
- name: Validate inputs
72+
id: validate_inputs
73+
run: |
74+
. ./.github/scripts/common/lib.sh
75+
76+
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
77+
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
78+
79+
build-runtimes:
80+
needs: [validate-inputs]
81+
uses: "./.github/workflows/release-srtool.yml"
82+
with:
83+
excluded_runtimes: "rococo asset-hub-rococo bridge-hub-rococo rococo substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template polkadot-sdk-docs-first pallet-staking-async-parachain pallet-staking-async-rc frame-storage-access-test yet-another-parachain revive-dev"
84+
build_opts: "--features on-chain-release-build"
85+
profile: production
86+
chain: ${{ inputs.chain }}
87+
runtime_dir: ${{ inputs.runtime_dir }}
88+
permissions:
89+
id-token: write
90+
attestations: write
91+
contents: read

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
validate-inputs:
6363
needs: [check-synchronization]
64-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
64+
if: needs.check-synchronization.outputs.checks_passed == 'true'
6565
runs-on: ubuntu-latest
6666
outputs:
6767
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}

.github/workflows/release-30_publish_release_draft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
validate-inputs:
6565
needs: [ check-synchronization ]
66-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
66+
if: needs.check-synchronization.outputs.checks_passed == 'true'
6767
runs-on: ubuntu-latest
6868
outputs:
6969
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}

.github/workflows/release-31_promote-rc-to-final.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
validate-inputs:
3030
needs: [ check-synchronization ]
31-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
31+
if: needs.check-synchronization.outputs.checks_passed == 'true'
3232
runs-on: ubuntu-latest
3333
outputs:
3434
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}

.github/workflows/release-40_publish-deb-package.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
uses: paritytech-release/sync-workflows/.github/workflows/check-synchronization.yml@main
2121
secrets:
2222
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
23+
<<<<<<< HEAD
2324

2425
validate-inputs:
2526
needs: [check-synchronization]
@@ -152,3 +153,16 @@ jobs:
152153
153154
# Invalidate caches to make sure latest files are served
154155
aws cloudfront create-invalidation --distribution-id E36FKEYWDXAZYJ --paths '/deb/*'
156+
=======
157+
call-publish-workflow:
158+
needs: [check-synchronization]
159+
if: needs.check-synchronization.outputs.checks_passed == 'true'
160+
uses: ./.github/workflows/release-reusable-publish-packages.yml
161+
with:
162+
tag: ${{ inputs.tag }}
163+
distribution: ${{ inputs.distribution }}
164+
package_type: 'deb'
165+
aws_repo_base_path: "s3://releases-package-repos"
166+
cloudfront_distribution_id: "E36FKEYWDXAZYJ"
167+
secrets: inherit
168+
>>>>>>> 97e54c54 ([CI|Release] Improve post crates action (#10803))
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release - Publish polkadot RPM package
2+
3+
# This workflow publishes the polkadot RPM package by calling a reusable workflow.
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: Current final release tag in the format polkadot-stableYYMM or polkadot-stable-YYMM-X
9+
default: polkadot-stable2412
10+
required: true
11+
type: string
12+
distribution:
13+
description: Distribution where to publish rpm package (release, staging)
14+
default: release
15+
required: true
16+
type: string
17+
18+
workflow_call:
19+
inputs:
20+
tag:
21+
description: Current final release tag in the format polkadot-stableYYMM or polkadot-stable-YYMM-X
22+
required: true
23+
type: string
24+
distribution:
25+
description: Distribution where to publish rpm package (release, staging)
26+
default: release
27+
required: true
28+
type: string
29+
30+
jobs:
31+
check-synchronization:
32+
uses: paritytech-release/sync-workflows/.github/workflows/check-synchronization.yml@main
33+
secrets:
34+
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
35+
call-publish-workflow:
36+
needs: [check-synchronization]
37+
if: needs.check-synchronization.outputs.checks_passed == 'true'
38+
uses: ./.github/workflows/release-reusable-publish-packages.yml
39+
with:
40+
tag: ${{ inputs.tag }}
41+
distribution: ${{ inputs.distribution }}
42+
package_type: 'rpm'
43+
aws_repo_base_path: ${{ inputs.distribution == 'release' && 's3://releases-package-repos' || 's3://staging-package-repos' }}
44+
cloudfront_distribution_id: "E36FKEYWDXAZYJ"
45+
secrets: inherit

.github/workflows/release-50_publish-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
validate-inputs:
7373
needs: [check-synchronization]
74-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
74+
if: needs.check-synchronization.outputs.checks_passed == 'true'
7575
runs-on: ubuntu-latest
7676
outputs:
7777
version: ${{ steps.validate_inputs.outputs.VERSION }}

0 commit comments

Comments
 (0)