Skip to content

Commit bece514

Browse files
authored
Merge branch 'alexggh/statement-store-not-api' into ae-sss-latency-bench-cli
2 parents 6cec444 + c40ce28 commit bece514

File tree

161 files changed

+6408
-618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+6408
-618
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
@@ -204,3 +211,50 @@ function get_s3_url_base() {
204211
;;
205212
esac
206213
}
214+
215+
# Bump spec_version in a runtime file based on release type
216+
# For patch release: bump last 3 digits (patch part) by 1
217+
# For new stable release: bump middle part (minor) by 1, reset patch to 0
218+
#
219+
# input:
220+
# - file: path to the runtime file
221+
# - is_patch_release: "true" for patch release, "false" for new stable
222+
# output: prints the new spec_version, modifies file in place
223+
bump_spec_version() {
224+
local file=$1
225+
local is_patch_release=$2
226+
227+
# Extract current spec_version from file (format: X_YYY_ZZZ)
228+
local current_spec=$(grep -oP 'spec_version:\s*\K[0-9]+_[0-9]+_[0-9]+' "$file" | head -1)
229+
230+
if [ -z "$current_spec" ]; then
231+
echo "⚠️ Warning: Could not find spec_version in $file"
232+
return 1
233+
fi
234+
235+
# Parse the spec_version (format: X_YYY_ZZZ)
236+
local major=$(echo "$current_spec" | cut -d'_' -f1)
237+
local minor=$(echo "$current_spec" | cut -d'_' -f2)
238+
local patch=$(echo "$current_spec" | cut -d'_' -f3)
239+
240+
# Remove leading zeros for arithmetic
241+
minor=$((10#$minor))
242+
patch=$((10#$patch))
243+
244+
if [ "$is_patch_release" = "true" ]; then
245+
# Patch release: bump patch part by 1
246+
patch=$((patch + 1))
247+
else
248+
# New stable release: bump minor by 1, reset patch to 0
249+
minor=$((minor + 1))
250+
patch=0
251+
fi
252+
253+
# Format back to X_YYY_ZZZ format (with proper zero padding)
254+
local new_spec=$(printf "%d_%03d_%03d" "$major" "$minor" "$patch")
255+
256+
# Replace in file
257+
sed -ri "s/spec_version: ${current_spec},/spec_version: ${new_spec},/" "$file"
258+
259+
echo "$new_spec"
260+
}

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

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

4141
validate-inputs:
4242
needs: [check-synchronization]
43-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
43+
if: needs.check-synchronization.outputs.checks_passed == 'true'
4444
runs-on: ubuntu-latest
4545
outputs:
4646
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}

.github/workflows/release-21_build-runtimes.yml

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

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

.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
@@ -43,7 +43,7 @@ jobs:
4343

4444
validate-inputs:
4545
needs: [ check-synchronization ]
46-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
46+
if: needs.check-synchronization.outputs.checks_passed == 'true'
4747
runs-on: ubuntu-latest
4848
outputs:
4949
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ on:
2929
type: string
3030

3131
jobs:
32+
check-synchronization:
33+
uses: paritytech-release/sync-workflows/.github/workflows/check-synchronization.yml@main
34+
secrets:
35+
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
3236
call-publish-workflow:
37+
needs: [check-synchronization]
38+
if: needs.check-synchronization.outputs.checks_passed == 'true'
3339
uses: ./.github/workflows/release-reusable-publish-packages.yml
3440
with:
3541
tag: ${{ inputs.tag }}

.github/workflows/release-41_publish-rpm-package.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ on:
2828
type: string
2929

3030
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 }}
3135
call-publish-workflow:
36+
needs: [check-synchronization]
37+
if: needs.check-synchronization.outputs.checks_passed == 'true'
3238
uses: ./.github/workflows/release-reusable-publish-packages.yml
3339
with:
3440
tag: ${{ inputs.tag }}

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

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

108108
validate-inputs:
109109
needs: [check-synchronization]
110-
if: ${{ needs.check-synchronization.outputs.checks_passed }} == 'true'
110+
if: needs.check-synchronization.outputs.checks_passed == 'true'
111111
runs-on: ubuntu-latest
112112
outputs:
113113
version: ${{ steps.validate_inputs.outputs.VERSION }}

.github/workflows/release-60_post-crates-release-activities.yml

Lines changed: 82 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
name: Release - Post Crates Release Activities
22

33
on:
4-
push:
5-
branches:
6-
- 'post-crates-release-*'
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Full release version identifier (e.g., stable2512 or stable2512-2)'
8+
required: true
9+
type: string
10+
bump_node_version:
11+
description: 'Bump NODE_VERSION? Select "yes" if this is the first run for this post-crates PR, "no" if re-running or if you have another reason not to bump'
12+
required: true
13+
type: choice
14+
options:
15+
- 'yes'
16+
- 'no'
17+
bump_spec_version:
18+
description: 'Bump spec_version? Select "yes" to bump spec version for all runtimes, "no" if re-running or if you have another reason not to bump'
19+
required: true
20+
type: choice
21+
options:
22+
- 'yes'
23+
- 'no'
724

825
permissions:
926
contents: write
@@ -68,6 +85,7 @@ jobs:
6885
git config --global user.signingKey "D8018FBB3F534D866A45998293C5FB5F6A367B51"
6986
7087
- name: Bump NODE_VERSION for polkadot
88+
if: inputs.bump_node_version == 'yes'
7189
run: |
7290
echo "Bumping NODE_VERSION in polkadot..."
7391
FILE="polkadot/node/primitives/src/lib.rs"
@@ -87,6 +105,7 @@ jobs:
87105
echo "Successfully bumped NODE_VERSION from $current_version to $new_version"
88106
89107
- name: Bump NODE_VERSION for polkadot-parachain and polkadot-omni-node
108+
if: inputs.bump_node_version == 'yes'
90109
run: |
91110
echo "Bumping NODE_VERSION in cumulus..."
92111
FILE="cumulus/polkadot-omni-node/lib/src/nodes/mod.rs"
@@ -106,6 +125,7 @@ jobs:
106125
echo "Successfully bumped NODE_VERSION from $current_version to $new_version"
107126
108127
- name: Commit NODE_VERSION bumps
128+
if: inputs.bump_node_version == 'yes'
109129
shell: bash
110130
run: |
111131
. ./.github/scripts/release/release_lib.sh
@@ -118,51 +138,72 @@ jobs:
118138
commit_with_message "Bump NODE_VERSION to $NODE_VERSION"
119139
echo "✅ Successfully committed NODE_VERSION bump"
120140
121-
- name: Move prdocs to release folder
141+
- name: Bump spec_version
142+
if: inputs.bump_spec_version == 'yes'
122143
shell: bash
123144
run: |
124145
. ./.github/scripts/release/release_lib.sh
125146
126-
# Extract release name from branch name (everything after "post-crates-release-")
127-
BRANCH_NAME="${{ github.ref_name }}"
128-
echo "Branch name: $BRANCH_NAME"
129-
130-
if [[ "$BRANCH_NAME" =~ post-crates-release-(.+)$ ]]; then
131-
RELEASE_FOLDER="${BASH_REMATCH[1]}"
132-
echo "Release folder name: $RELEASE_FOLDER"
147+
FILE="polkadot/node/primitives/src/lib.rs"
148+
NODE_VERSION=$(grep 'pub const NODE_VERSION' "$FILE" | grep -oE '"[0-9]+\.[0-9]+\.[0-9]+"' | tr -d '"')
133149
134-
# Use the reorder_prdocs helper function
135-
reorder_prdocs "$RELEASE_FOLDER"
150+
# Determine if this is a patch release or new stable release
151+
patch=$(echo "$NODE_VERSION" | awk -F'[.-]' '{print $3}')
152+
if [ "$patch" -gt 0 ]; then
153+
IS_PATCH_RELEASE="true"
154+
printf "📋 Patch release detected (patch=$patch) - bumping spec_version patch part\n"
136155
else
137-
echo "WARNING: Could not extract release name from branch name: $BRANCH_NAME"
138-
echo "Expected format: post-crates-release-<release-name>"
139-
exit 1
156+
IS_PATCH_RELEASE="false"
157+
printf "📋 New stable release detected - bumping spec_version minor part\n"
140158
fi
141159
160+
runtimes_list=$(get_filtered_runtimes_list)
161+
162+
for f in ${runtimes_list[@]}; do
163+
new_version=$(bump_spec_version "$f" "$IS_PATCH_RELEASE")
164+
printf " 🔄 $f → spec_version: $new_version\n"
165+
done
166+
167+
commit_with_message "Bump spec_version for $([ \"$IS_PATCH_RELEASE\" = \"true\" ] && echo \"patch\" || echo \"stable\") release"
168+
169+
- name: Move prdocs to release folder
170+
shell: bash
171+
run: |
172+
. ./.github/scripts/release/release_lib.sh
173+
174+
VERSION="${{ inputs.version }}"
175+
echo "Version: $VERSION"
176+
177+
reorder_prdocs "$VERSION"
178+
142179
- name: Replace path dependencies
143180
run: |
144181
echo "Running replace-all-path-deps.sh..."
145182
bash scripts/release/replace-all-path-deps.sh
146-
183+
147184
# Show git diff to see what changed
148185
git diff --stat
149186
150187
- name: Remove versions where path deps are present
151188
run: |
152189
echo "Running delete-versions-if-path-is-present.sh..."
153190
bash scripts/release/delete-versions-if-path-is-present.sh
154-
191+
155192
# Show git diff to see what changed
156193
git diff --stat
157194
158195
- name: Remove version from umbrella/Cargo.toml
159196
run: |
160197
echo "Running delete-version-from-umbrella.sh..."
161198
bash scripts/release/delete-version-from-umbrella.sh
162-
199+
163200
# Show git diff to see what changed
164201
git diff --stat
165202
203+
- name: Install newer Zepter
204+
run: |
205+
cargo install [email protected] --locked -q && zepter --version
206+
166207
- name: Run Zepter - check issues
167208
run: |
168209
echo "Running zepter run check to identify issues..."
@@ -248,32 +289,36 @@ jobs:
248289
shell: bash
249290
run: |
250291
BRANCH_NAME="${{ github.ref_name }}"
292+
FULL_RELEASE="${{ inputs.version }}"
251293
echo "Current branch: $BRANCH_NAME"
294+
echo "Version: $FULL_RELEASE"
252295
253-
# Extract base release branch name
254-
if [[ "$BRANCH_NAME" =~ ^post-crates-release-(.+)$ ]]; then
255-
FULL_RELEASE="${BASH_REMATCH[1]}"
296+
# Extract base release branch name by removing the last segment after dash
297+
if [[ "$FULL_RELEASE" =~ ^(.+)-[^-]+$ ]]; then
298+
BASE_RELEASE="${BASH_REMATCH[1]}"
299+
else
300+
BASE_RELEASE="$FULL_RELEASE"
301+
fi
256302
257-
if [[ "$FULL_RELEASE" =~ ^(.+)-[^-]+$ ]]; then
258-
BASE_RELEASE="${BASH_REMATCH[1]}"
259-
else
260-
BASE_RELEASE="$FULL_RELEASE"
261-
fi
303+
# Check if PR already exists
304+
EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --base "$BASE_RELEASE" --json number --jq '.[0].number')
262305
306+
if [ -n "$EXISTING_PR" ]; then
307+
echo "✅ PR #$EXISTING_PR already exists for this branch"
308+
echo "PR URL: $(gh pr view $EXISTING_PR --json url --jq '.url')"
309+
else
263310
echo "Creating PR from $BRANCH_NAME to $BASE_RELEASE..."
264311
gh pr create \
265-
--title "Post crates release activities for $BASE_RELEASE" \
312+
--title "[${BASE_RELEASE}] Post crates release activities for $FULL_RELEASE" \
266313
--body "Automated PR containing post-crates-release activities:
267-
- NODE_VERSION bumps
268-
- Path dependencies replacement
269-
- Zepter fixes
270-
- Taplo formatting
271-
- PRDocs reorganization" \
314+
- NODE_VERSION bumps (if selected)
315+
- Path dependencies replacement
316+
- Zepter fixes
317+
- Taplo formatting
318+
- PRDocs reorganization (if prdocs exist)" \
272319
--base "$BASE_RELEASE" \
273-
--head "$BRANCH_NAME" || echo "PR may already exist or there was an error creating it"
274-
else
275-
echo "ERROR: Could not extract base release branch from: $BRANCH_NAME, probably wrong format"
276-
exit 1
320+
--head "$BRANCH_NAME"
321+
echo "✅ PR created successfully"
277322
fi
278323
279324
- name: Add comment about spec_version

0 commit comments

Comments
 (0)