From 263509f872f3ae1791dd437973fa1937e87b4410 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 6 Nov 2025 14:13:15 +0100 Subject: [PATCH 1/9] Test sha output --- .github/workflows/manual.yml | 117 +++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 54 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 741fdb0..475dba6 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -44,6 +44,9 @@ on: jobs: build: + outputs: + polkadot_sdk_checkout_hash: ${{ steps.getsha.outputs.sha }} + name: Build ${{ github.event.inputs.repository }}/${{ github.event.inputs.package }} ${{ github.event.inputs.ref }} runs-on: ubuntu-latest steps: @@ -53,61 +56,67 @@ jobs: ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - - name: Srtool build - id: srtool_build - uses: chevdor/srtool-actions@v0.9.2 - env: - BUILD_OPTS: ${{ inputs.build_opts }} - with: - chain: ${{ github.event.inputs.chain }} - package: ${{ github.event.inputs.package }} - image: ${{ github.event.inputs.srtool_image }} - tag: ${{ github.event.inputs.srtool_tag }} - runtime_dir: ${{ github.event.inputs.runtime_dir }} - profile: ${{ github.event.inputs.profile }} - - - name: Summary + - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} + id: getsha + working-directory: ${{ github.event.inputs.repository }} run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ github.event.inputs.chain }}-srtool-digest.json - cat ${{ github.event.inputs.chain }}-srtool-digest.json - echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" + echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - # it takes a while to build the runtime, so let's save the artifact as soon as we have it - - name: Archive Artifacts for ${{ github.event.inputs.chain }} - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.inputs.chain }}-runtime - path: | - ${{ steps.srtool_build.outputs.wasm }} - ${{ steps.srtool_build.outputs.wasm_compressed }} - ${{ github.event.inputs.chain }}-srtool-digest.json + # - name: Srtool build + # id: srtool_build + # uses: chevdor/srtool-actions@v0.9.2 + # env: + # BUILD_OPTS: ${{ inputs.build_opts }} + # with: + # chain: ${{ github.event.inputs.chain }} + # package: ${{ github.event.inputs.package }} + # image: ${{ github.event.inputs.srtool_image }} + # tag: ${{ github.event.inputs.srtool_tag }} + # runtime_dir: ${{ github.event.inputs.runtime_dir }} + # profile: ${{ github.event.inputs.profile }} - # We now get extra information thanks to subwasm, - - name: Install subwasm ${{ env.SUBWASM_VERSION }} - run: | - wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - subwasm --version - - name: Show Runtime information - run: | - subwasm info ${{ steps.srtool_build.outputs.wasm }} - subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} - subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.json - subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-info_compressed.json - - name: Extract the metadata - run: | - subwasm meta ${{ steps.srtool_build.outputs.wasm }} - subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-metadata.json - - name: Check the metadata diff - run: | - subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ github.event.inputs.chain }} | tee ${{ github.event.inputs.chain }}-diff.txt + # - name: Summary + # run: | + # echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ github.event.inputs.chain }}-srtool-digest.json + # cat ${{ github.event.inputs.chain }}-srtool-digest.json + # echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" - - name: Archive Subwasm results - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.inputs.chain }}-runtime-info - path: | - ${{ github.event.inputs.chain }}-info.json - ${{ github.event.inputs.chain }}-info_compressed.json - ${{ github.event.inputs.chain }}-metadata.json - ${{ github.event.inputs.chain }}-diff.txt + # # it takes a while to build the runtime, so let's save the artifact as soon as we have it + # - name: Archive Artifacts for ${{ github.event.inputs.chain }} + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ github.event.inputs.chain }}-runtime + # path: | + # ${{ steps.srtool_build.outputs.wasm }} + # ${{ steps.srtool_build.outputs.wasm_compressed }} + # ${{ github.event.inputs.chain }}-srtool-digest.json + + # # We now get extra information thanks to subwasm, + # - name: Install subwasm ${{ env.SUBWASM_VERSION }} + # run: | + # wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + # sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + # subwasm --version + # - name: Show Runtime information + # run: | + # subwasm info ${{ steps.srtool_build.outputs.wasm }} + # subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} + # subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.json + # subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-info_compressed.json + # - name: Extract the metadata + # run: | + # subwasm meta ${{ steps.srtool_build.outputs.wasm }} + # subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-metadata.json + # - name: Check the metadata diff + # run: | + # subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ github.event.inputs.chain }} | tee ${{ github.event.inputs.chain }}-diff.txt + + # - name: Archive Subwasm results + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ github.event.inputs.chain }}-runtime-info + # path: | + # ${{ github.event.inputs.chain }}-info.json + # ${{ github.event.inputs.chain }}-info_compressed.json + # ${{ github.event.inputs.chain }}-metadata.json + # ${{ github.event.inputs.chain }}-diff.txt From d082cad0c599601319de12410569ee3495f25090 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 6 Nov 2025 14:25:52 +0100 Subject: [PATCH 2/9] test anotherworking directory --- .github/workflows/manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 475dba6..99e9d9d 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -58,7 +58,7 @@ jobs: - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} id: getsha - working-directory: ${{ github.event.inputs.repository }} + working-directory: polkadot-sdk run: | echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT From da2185308a1c289a2a63ef06f329a5cadb087461 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 6 Nov 2025 14:34:12 +0100 Subject: [PATCH 3/9] try without wroking_directory --- .github/workflows/manual.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 99e9d9d..0867af3 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -58,7 +58,6 @@ jobs: - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} id: getsha - working-directory: polkadot-sdk run: | echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT From b18f5d19fe96a3263458dbf9f01a7a5485cff033 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 6 Nov 2025 15:10:04 +0100 Subject: [PATCH 4/9] Debug --- .github/workflows/manual.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 0867af3..a918912 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -59,7 +59,13 @@ jobs: - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} id: getsha run: | - echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + sha=$(git rev-parse --short HEAD) + echo "sha: $sha" + echo "sha=$sha" >> $GITHUB_OUTPUT + - name: Debug SDK SHA + run: | + echo "Building with SDK SHA: ${{ steps.getsha.outputs.sha }}" + # - name: Srtool build # id: srtool_build From 6aec40161cd2d5769d907fed3cb6d9a616ffb019 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 6 Nov 2025 17:43:35 +0100 Subject: [PATCH 5/9] Try with file --- .github/workflows/manual.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index a918912..b7ca9b0 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -44,9 +44,6 @@ on: jobs: build: - outputs: - polkadot_sdk_checkout_hash: ${{ steps.getsha.outputs.sha }} - name: Build ${{ github.event.inputs.repository }}/${{ github.event.inputs.package }} ${{ github.event.inputs.ref }} runs-on: ubuntu-latest steps: @@ -57,15 +54,16 @@ jobs: fetch-depth: 0 - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} - id: getsha run: | sha=$(git rev-parse --short HEAD) echo "sha: $sha" - echo "sha=$sha" >> $GITHUB_OUTPUT - - name: Debug SDK SHA - run: | - echo "Building with SDK SHA: ${{ steps.getsha.outputs.sha }}" + echo "$sha" > sdk-checkout-sha.txt + - name: Upload SHA artifact + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0 + with: + name: sdk-checkout-sha + path: sdk-checkout-sha.txt # - name: Srtool build # id: srtool_build @@ -117,7 +115,7 @@ jobs: # subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ github.event.inputs.chain }} | tee ${{ github.event.inputs.chain }}-diff.txt # - name: Archive Subwasm results - # uses: actions/upload-artifact@v4 + # uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0 # with: # name: ${{ github.event.inputs.chain }}-runtime-info # path: | From 4e931edf891080db70e0bfb486c5bae79fa254ea Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 7 Nov 2025 10:53:14 +0100 Subject: [PATCH 6/9] Test the pipline --- .github/workflows/manual.yml | 109 ++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index b7ca9b0..f205e06 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -55,6 +55,7 @@ jobs: - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} run: | + # The sha from the polkadot-sdk checkout will be used later to connect a runtime build with the uplaoded artifact sha=$(git rev-parse --short HEAD) echo "sha: $sha" echo "$sha" > sdk-checkout-sha.txt @@ -65,61 +66,61 @@ jobs: name: sdk-checkout-sha path: sdk-checkout-sha.txt - # - name: Srtool build - # id: srtool_build - # uses: chevdor/srtool-actions@v0.9.2 - # env: - # BUILD_OPTS: ${{ inputs.build_opts }} - # with: - # chain: ${{ github.event.inputs.chain }} - # package: ${{ github.event.inputs.package }} - # image: ${{ github.event.inputs.srtool_image }} - # tag: ${{ github.event.inputs.srtool_tag }} - # runtime_dir: ${{ github.event.inputs.runtime_dir }} - # profile: ${{ github.event.inputs.profile }} + - name: Srtool build + id: srtool_build + uses: chevdor/srtool-actions@v0.9.2 + env: + BUILD_OPTS: ${{ inputs.build_opts }} + with: + chain: ${{ github.event.inputs.chain }} + package: ${{ github.event.inputs.package }} + image: ${{ github.event.inputs.srtool_image }} + tag: ${{ github.event.inputs.srtool_tag }} + runtime_dir: ${{ github.event.inputs.runtime_dir }} + profile: ${{ github.event.inputs.profile }} - # - name: Summary - # run: | - # echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ github.event.inputs.chain }}-srtool-digest.json - # cat ${{ github.event.inputs.chain }}-srtool-digest.json - # echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" + - name: Summary + run: | + echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ github.event.inputs.chain }}-srtool-digest.json + cat ${{ github.event.inputs.chain }}-srtool-digest.json + echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" - # # it takes a while to build the runtime, so let's save the artifact as soon as we have it - # - name: Archive Artifacts for ${{ github.event.inputs.chain }} - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ github.event.inputs.chain }}-runtime - # path: | - # ${{ steps.srtool_build.outputs.wasm }} - # ${{ steps.srtool_build.outputs.wasm_compressed }} - # ${{ github.event.inputs.chain }}-srtool-digest.json + # it takes a while to build the runtime, so let's save the artifact as soon as we have it + - name: Archive Artifacts for ${{ github.event.inputs.chain }} + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.inputs.chain }}-runtime + path: | + ${{ steps.srtool_build.outputs.wasm }} + ${{ steps.srtool_build.outputs.wasm_compressed }} + ${{ github.event.inputs.chain }}-srtool-digest.json - # # We now get extra information thanks to subwasm, - # - name: Install subwasm ${{ env.SUBWASM_VERSION }} - # run: | - # wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - # sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb - # subwasm --version - # - name: Show Runtime information - # run: | - # subwasm info ${{ steps.srtool_build.outputs.wasm }} - # subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} - # subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.json - # subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-info_compressed.json - # - name: Extract the metadata - # run: | - # subwasm meta ${{ steps.srtool_build.outputs.wasm }} - # subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-metadata.json - # - name: Check the metadata diff - # run: | - # subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ github.event.inputs.chain }} | tee ${{ github.event.inputs.chain }}-diff.txt + # We now get extra information thanks to subwasm, + - name: Install subwasm ${{ env.SUBWASM_VERSION }} + run: | + wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb + subwasm --version + - name: Show Runtime information + run: | + subwasm info ${{ steps.srtool_build.outputs.wasm }} + subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} + subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.json + subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-info_compressed.json + - name: Extract the metadata + run: | + subwasm meta ${{ steps.srtool_build.outputs.wasm }} + subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-metadata.json + - name: Check the metadata diff + run: | + subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ github.event.inputs.chain }} | tee ${{ github.event.inputs.chain }}-diff.txt - # - name: Archive Subwasm results - # uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0 - # with: - # name: ${{ github.event.inputs.chain }}-runtime-info - # path: | - # ${{ github.event.inputs.chain }}-info.json - # ${{ github.event.inputs.chain }}-info_compressed.json - # ${{ github.event.inputs.chain }}-metadata.json - # ${{ github.event.inputs.chain }}-diff.txt + - name: Archive Subwasm results + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0 + with: + name: ${{ github.event.inputs.chain }}-runtime-info + path: | + ${{ github.event.inputs.chain }}-info.json + ${{ github.event.inputs.chain }}-info_compressed.json + ${{ github.event.inputs.chain }}-metadata.json + ${{ github.event.inputs.chain }}-diff.txt From c6b104e9a659c03d164813ab8bec32c19cbf50c3 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 7 Nov 2025 15:36:01 +0100 Subject: [PATCH 7/9] Use commit has for the sdk checkout instead of a branch name --- .github/workflows/manual.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index f205e06..ff4ed31 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1,5 +1,6 @@ name: Manual Build +run-name: Build for ${{ github.event.inputs.ref }} env: SUBWASM_VERSION: 0.21.0 @@ -31,8 +32,7 @@ on: default: polkadot/runtime/westend required: true ref: - description: The ref to be used for the repo - default: master + description: The github commit hash to be used for the repo to be built from (this should be a commit hash and not a branch name) required: false build_opts: description: The build options to be used to build runtime e.g. --features on-chain-release-build (can be left empty) From f40a3c944852d0227cd15825a7450f668dc7746e Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 7 Nov 2025 17:19:03 +0100 Subject: [PATCH 8/9] Cleanup --- .github/workflows/manual.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index ff4ed31..5987bac 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -53,19 +53,6 @@ jobs: ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - - name: Get commit hash for ${{ github.event.inputs.repository }} ${{ github.event.inputs.ref }} - run: | - # The sha from the polkadot-sdk checkout will be used later to connect a runtime build with the uplaoded artifact - sha=$(git rev-parse --short HEAD) - echo "sha: $sha" - echo "$sha" > sdk-checkout-sha.txt - - - name: Upload SHA artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0 - with: - name: sdk-checkout-sha - path: sdk-checkout-sha.txt - - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.9.2 From 080b59eec14062b96bc0ffcd505c41e6b13b4e3a Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 7 Nov 2025 17:28:47 +0100 Subject: [PATCH 9/9] adjust fellowship test --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d83f0fb..0f4e9ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -347,7 +347,7 @@ jobs: CMD="docker run --rm -i \ -e PACKAGE=$PACKAGE \ -e RUNTIME_DIR=$RUNTIME_DIR \ - -e RUSTC_VERSION=1.81.0 \ + -e RUSTC_VERSION=1.88.0 \ -e WASM_BUILD_STD=0 \ -v ${PWD}:/build \ srtool build --app --json"