From df3922dd35a9a05f6c30ceb7e00b17d80c108f20 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 27 Jun 2024 17:20:41 +0200 Subject: [PATCH 01/14] add runtimes build options to srtool build --- .github/workflows/release-30_publish_release_draft.yml | 1 + .github/workflows/release-srtool.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 20492f2d3a91..59a4596838ee 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -26,6 +26,7 @@ jobs: uses: "./.github/workflows/release-srtool.yml" with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" + build_opts: "--features metadata-hash" build-binaries: runs-on: ubuntu-latest diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index 69a4bdbdda9a..64f84517ec35 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -14,6 +14,8 @@ on: inputs: excluded_runtimes: type: string + build_opts: + type: string outputs: published_runtimes: value: ${{ jobs.find-runtimes.outputs.runtime }} @@ -79,6 +81,8 @@ jobs: - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.9.2 + env: + BUILD_OPTS: ${{ inputs.build_opts }} with: chain: ${{ matrix.chain }} runtime_dir: ${{ matrix.runtime_dir }} From f611426db494dcc9212e9c9f0f3bf7c3ee55047c Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 5 Jul 2024 15:16:57 +0200 Subject: [PATCH 02/14] add srtool build with options --- .github/workflows/release-srtool.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index 64f84517ec35..33a5803f3456 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -79,8 +79,17 @@ jobs: fetch-depth: 0 - name: Srtool build + if: ${{ matrix.chain != 'asset-hub-rococo' || matrix.chain != 'asset-hub-westend' || matrix.chain != 'rococo' || matrix.chain != 'westend' }} id: srtool_build uses: chevdor/srtool-actions@v0.9.2 + with: + chain: ${{ matrix.chain }} + runtime_dir: ${{ matrix.runtime_dir }} + + - name: Srtool build with options + if: ${{ matrix.chain == 'asset-hub-rococo' || matrix.chain == 'asset-hub-westend' || matrix.chain == 'rococo' || matrix.chain == 'westend' }} + id: srtool_build_with_opts + uses: chevdor/srtool-actions@v0.9.2 env: BUILD_OPTS: ${{ inputs.build_opts }} with: From a45ad832bf85786b48999f7b8561fa43800c7bb4 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 5 Jul 2024 15:31:28 +0200 Subject: [PATCH 03/14] add additional step to set build options --- .github/workflows/release-srtool.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index 33a5803f3456..ad7afffbaad1 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -78,20 +78,20 @@ jobs: with: fetch-depth: 0 + - name: Prepare build options + run: | + BUILD_OPTIONS="" + if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then + BUILD_OPTIONS=${{ inputs.build_opts }} + fi + + echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV + - name: Srtool build - if: ${{ matrix.chain != 'asset-hub-rococo' || matrix.chain != 'asset-hub-westend' || matrix.chain != 'rococo' || matrix.chain != 'westend' }} id: srtool_build uses: chevdor/srtool-actions@v0.9.2 - with: - chain: ${{ matrix.chain }} - runtime_dir: ${{ matrix.runtime_dir }} - - - name: Srtool build with options - if: ${{ matrix.chain == 'asset-hub-rococo' || matrix.chain == 'asset-hub-westend' || matrix.chain == 'rococo' || matrix.chain == 'westend' }} - id: srtool_build_with_opts - uses: chevdor/srtool-actions@v0.9.2 env: - BUILD_OPTS: ${{ inputs.build_opts }} + BUILD_OPTS: ${{ github.env.BUILD_OPTIONS }} with: chain: ${{ matrix.chain }} runtime_dir: ${{ matrix.runtime_dir }} From 8b4b2f2d0cc5127509cb5ef19096b0b751d419a7 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 5 Jul 2024 15:37:50 +0200 Subject: [PATCH 04/14] add qoutes --- .github/workflows/release-srtool.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index ad7afffbaad1..e924f6ce9373 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -82,7 +82,7 @@ jobs: run: | BUILD_OPTIONS="" if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then - BUILD_OPTIONS=${{ inputs.build_opts }} + BUILD_OPTIONS="${{ inputs.build_opts }}" fi echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV From defe4a47819c10af78769880785085d1ac908a72 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Fri, 5 Jul 2024 15:53:33 +0200 Subject: [PATCH 05/14] change scope of BUILD_OPTIONS --- .github/workflows/release-srtool.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index e924f6ce9373..b085802b59d3 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -91,7 +91,7 @@ jobs: id: srtool_build uses: chevdor/srtool-actions@v0.9.2 env: - BUILD_OPTS: ${{ github.env.BUILD_OPTIONS }} + BUILD_OPTS: ${{ env.BUILD_OPTIONS }} with: chain: ${{ matrix.chain }} runtime_dir: ${{ matrix.runtime_dir }} From 8b08e5fa85b283dfff7f0a1987529b25688e6820 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Mon, 8 Jul 2024 15:32:34 +0200 Subject: [PATCH 06/14] chaneg build optas and add a job to build runtimes with logging activated --- .../release-30_publish_release_draft.yml | 36 +++++++++++++++++-- .github/workflows/release-srtool.yml | 20 ++++++----- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 59a4596838ee..07fbf14071ba 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -1,5 +1,8 @@ name: Release - Publish draft +env: + LOGGING_NAME_SUFFIX: "logging" + on: push: tags: @@ -26,7 +29,15 @@ jobs: uses: "./.github/workflows/release-srtool.yml" with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" - build_opts: "--features metadata-hash" + build_opts: "--features on-chain-release-build" + name_suffix: "" + + build-runtimes-with-logging: + uses: "./.github/workflows/release-srtool.yml" + with: + excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" + build_opts: "" + name_suffix: "-${{ github.env.LOGGING_NAME_SUFFIX }}" build-binaries: runs-on: ubuntu-latest @@ -146,6 +157,27 @@ jobs: >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm') >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) + publish-runtimes-with-logging: + needs: [ build-runtimes-with-logging, publish-release-draft ] + continue-on-error: true + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJSON(needs.build-runtimes-with-logging.outputs.published_runtimes) }} + + steps: + - name: Checkout sources + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + + - name: Download artifacts + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + + - name: Get runtime info + env: + JSON: release-notes-context/${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }}/${{ matrix.chain }}-srtool-digest.json + run: | + >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }} -name '*.compact.compressed.wasm') + >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) + - name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm if: ${{ matrix.chain != 'rococo-parachain' }} uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 @@ -154,7 +186,7 @@ jobs: with: upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} asset_path: ${{ env.ASSET }} - asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm + asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}-${{ env.LOGGING_NAME_SUFFIX }}.compact.compressed.wasm asset_content_type: application/wasm publish-binaries: diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index b085802b59d3..9bb387cc5a6a 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -16,6 +16,8 @@ on: type: string build_opts: type: string + name_suffix: + type: string outputs: published_runtimes: value: ${{ jobs.find-runtimes.outputs.runtime }} @@ -78,20 +80,20 @@ jobs: with: fetch-depth: 0 - - name: Prepare build options - run: | - BUILD_OPTIONS="" - if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then - BUILD_OPTIONS="${{ inputs.build_opts }}" - fi + # - name: Prepare build options + # run: | + # BUILD_OPTIONS="" + # if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then + # BUILD_OPTIONS="${{ inputs.build_opts }}" + # fi - echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV + # echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.9.2 env: - BUILD_OPTS: ${{ env.BUILD_OPTIONS }} + BUILD_OPTS: ${{ inputs.build_opts }} with: chain: ${{ matrix.chain }} runtime_dir: ${{ matrix.runtime_dir }} @@ -135,7 +137,7 @@ jobs: - name: Archive Subwasm results uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: ${{ matrix.chain }}-runtime + name: ${{ matrix.chain }}-runtime${{ inputs.name_suffix }} path: | ${{ matrix.chain }}-info.json ${{ matrix.chain }}-compressed-info.json From 79d34743799e807f0de182edeb0eae594d6b4b51 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 9 Jul 2024 09:53:29 +0200 Subject: [PATCH 07/14] add on-chain-release-build feature to where it is missing --- .github/workflows/release-srtool.yml | 9 --------- .../parachains/runtimes/people/people-rococo/Cargo.toml | 5 +++++ .../parachains/runtimes/people/people-westend/Cargo.toml | 5 +++++ .../runtimes/testing/rococo-parachain/Cargo.toml | 5 +++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index 9bb387cc5a6a..4b62a3fddd4e 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -80,15 +80,6 @@ jobs: with: fetch-depth: 0 - # - name: Prepare build options - # run: | - # BUILD_OPTIONS="" - # if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then - # BUILD_OPTIONS="${{ inputs.build_opts }}" - # fi - - # echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV - - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.9.2 diff --git a/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml b/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml index 890de672e0b5..9121d0bc41a6 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml @@ -193,3 +193,8 @@ try-runtime = [ "polkadot-runtime-common/try-runtime", "sp-runtime/try-runtime", ] + +# A feature that should be enabled when the runtime should be built for on-chain +# deployment. This will disable stuff that shouldn't be part of the on-chain wasm +# to make it smaller, like logging for example. +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/people/people-westend/Cargo.toml b/cumulus/parachains/runtimes/people/people-westend/Cargo.toml index 83068e489d2e..e60b95dd915b 100644 --- a/cumulus/parachains/runtimes/people/people-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/people/people-westend/Cargo.toml @@ -193,3 +193,8 @@ try-runtime = [ "polkadot-runtime-common/try-runtime", "sp-runtime/try-runtime", ] + +# A feature that should be enabled when the runtime should be built for on-chain +# deployment. This will disable stuff that shouldn't be part of the on-chain wasm +# to make it smaller, like logging for example. +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml b/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml index 7cbb614babe7..38b54651cefb 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml @@ -136,3 +136,8 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", ] + +# A feature that should be enabled when the runtime should be built for on-chain +# deployment. This will disable stuff that shouldn't be part of the on-chain wasm +# to make it smaller, like logging for example. +on-chain-release-build = [] From 213574f9b56853d06c23696e5d89132d9c950449 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 9 Jul 2024 13:59:54 +0200 Subject: [PATCH 08/14] add upload runtiems without logging --- .../workflows/release-30_publish_release_draft.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 07fbf14071ba..01e7577e0c05 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -37,7 +37,7 @@ jobs: with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" build_opts: "" - name_suffix: "-${{ github.env.LOGGING_NAME_SUFFIX }}" + name_suffix: "-${LOGGING_NAME_SUFFIX}" build-binaries: runs-on: ubuntu-latest @@ -157,6 +157,17 @@ jobs: >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm') >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) + - name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm + if: ${{ matrix.chain != 'rococo-parachain' }} + uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} + asset_path: ${{ env.ASSET }} + asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm + asset_content_type: application/wasm + publish-runtimes-with-logging: needs: [ build-runtimes-with-logging, publish-release-draft ] continue-on-error: true From 1ccbc2aa227e3d89debe3d8b481af7aafa7e7381 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 9 Jul 2024 17:07:02 +0200 Subject: [PATCH 09/14] change call of the env --- .github/workflows/release-30_publish_release_draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 01e7577e0c05..21bb9ac9d642 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -37,7 +37,7 @@ jobs: with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" build_opts: "" - name_suffix: "-${LOGGING_NAME_SUFFIX}" + name_suffix: "-${{ env.LOGGING_NAME_SUFFIX }}" build-binaries: runs-on: ubuntu-latest From 6ad1e29f68968d8af351309835a44215a8db3413 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 9 Jul 2024 17:20:24 +0200 Subject: [PATCH 10/14] hardcode suffix as reusable workflow does not parse env --- .github/workflows/release-30_publish_release_draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 21bb9ac9d642..86af6ffa13c8 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -37,7 +37,7 @@ jobs: with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" build_opts: "" - name_suffix: "-${{ env.LOGGING_NAME_SUFFIX }}" + name_suffix: "-logging" build-binaries: runs-on: ubuntu-latest From 8698c39fd016cd2378a5521a4316d4bd44b9643d Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Wed, 10 Jul 2024 09:48:09 +0200 Subject: [PATCH 11/14] adjust path to release-notes-context.json --- .github/workflows/release-30_publish_release_draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index 86af6ffa13c8..5dd8ddf03d0e 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -184,7 +184,7 @@ jobs: - name: Get runtime info env: - JSON: release-notes-context/${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }}/${{ matrix.chain }}-srtool-digest.json + JSON: release-notes-context/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json run: | >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }} -name '*.compact.compressed.wasm') >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) From cff9c73709dbf2e0ca4f7396a1436b6c0c6333aa Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Wed, 31 Jul 2024 17:16:51 +0200 Subject: [PATCH 12/14] delete `disable-logging` and adjust flow to build runtimes only one time --- .../release-30_publish_release_draft.yml | 43 ------------------- .github/workflows/release-srtool.yml | 4 +- .../assets/asset-hub-rococo/Cargo.toml | 2 +- .../assets/asset-hub-westend/Cargo.toml | 2 +- .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 2 +- .../bridge-hubs/bridge-hub-westend/Cargo.toml | 2 +- .../collectives-westend/Cargo.toml | 2 +- .../contracts/contracts-rococo/Cargo.toml | 2 +- .../coretime/coretime-rococo/Cargo.toml | 2 +- .../coretime/coretime-westend/Cargo.toml | 2 +- .../glutton/glutton-westend/Cargo.toml | 2 +- polkadot/runtime/rococo/Cargo.toml | 2 +- polkadot/runtime/westend/Cargo.toml | 2 +- 13 files changed, 12 insertions(+), 57 deletions(-) diff --git a/.github/workflows/release-30_publish_release_draft.yml b/.github/workflows/release-30_publish_release_draft.yml index edc6e4169d10..4343dbf915a9 100644 --- a/.github/workflows/release-30_publish_release_draft.yml +++ b/.github/workflows/release-30_publish_release_draft.yml @@ -1,8 +1,5 @@ name: Release - Publish draft -env: - LOGGING_NAME_SUFFIX: "logging" - on: push: tags: @@ -30,14 +27,6 @@ jobs: with: excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" build_opts: "--features on-chain-release-build" - name_suffix: "" - - build-runtimes-with-logging: - uses: "./.github/workflows/release-srtool.yml" - with: - excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" - build_opts: "" - name_suffix: "-logging" build-binaries: runs-on: ubuntu-latest @@ -168,38 +157,6 @@ jobs: asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm asset_content_type: application/wasm - publish-runtimes-with-logging: - needs: [ build-runtimes-with-logging, publish-release-draft ] - continue-on-error: true - runs-on: ubuntu-latest - strategy: - matrix: ${{ fromJSON(needs.build-runtimes-with-logging.outputs.published_runtimes) }} - - steps: - - name: Checkout sources - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - - - name: Get runtime info - env: - JSON: release-notes-context/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json - run: | - >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }} -name '*.compact.compressed.wasm') - >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) - - - name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm - if: ${{ matrix.chain != 'rococo-parachain' }} - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}-${{ env.LOGGING_NAME_SUFFIX }}.compact.compressed.wasm - asset_content_type: application/wasm - publish-binaries: needs: [ publish-release-draft, build-binaries ] continue-on-error: true diff --git a/.github/workflows/release-srtool.yml b/.github/workflows/release-srtool.yml index 7576a7ea872c..262203f05005 100644 --- a/.github/workflows/release-srtool.yml +++ b/.github/workflows/release-srtool.yml @@ -11,8 +11,6 @@ on: type: string build_opts: type: string - name_suffix: - type: string outputs: published_runtimes: value: ${{ jobs.find-runtimes.outputs.runtime }} @@ -123,7 +121,7 @@ jobs: - name: Archive Subwasm results uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: ${{ matrix.chain }}-runtime${{ inputs.name_suffix }} + name: ${{ matrix.chain }}-runtime path: | ${{ matrix.chain }}-info.json ${{ matrix.chain }}-compressed-info.json diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml index 98df41090a40..0143c09036d2 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml @@ -258,4 +258,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml index 6b1bf769ace3..5291c5d4cd72 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml @@ -257,4 +257,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 7a60a3f64840..47c0012b8a6a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -303,4 +303,4 @@ fast-runtime = [] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml index 4326cbf926d6..19047d88159e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml @@ -254,4 +254,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml b/cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml index 43fc9083937c..e98508ea02e6 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml @@ -243,4 +243,4 @@ std = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml b/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml index 1fcebb3f16a9..dfa75b8d3cf3 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml @@ -203,4 +203,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml b/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml index 2920bc428d90..07d133c80be7 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml @@ -209,4 +209,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml b/cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml index 07a4332800d7..5029c82f971d 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml @@ -206,4 +206,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] diff --git a/cumulus/parachains/runtimes/glutton/glutton-westend/Cargo.toml b/cumulus/parachains/runtimes/glutton/glutton-westend/Cargo.toml index d20b62a557b9..09b4ef679d24 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/glutton/glutton-westend/Cargo.toml @@ -136,4 +136,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = [] diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index 50970965e11e..4aaaf94da586 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -339,4 +339,4 @@ runtime-metrics = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index 4226595cd2ff..83c0eb037f4a 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -358,4 +358,4 @@ runtime-metrics = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["metadata-hash"] From 6b9d7378978a4a581f9bb0840cbcd0f5e89592a6 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Thu, 22 Aug 2024 13:29:40 +0000 Subject: [PATCH 13/14] Add PrDoc (auto generated) --- prdoc/pr_4956.prdoc | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 prdoc/pr_4956.prdoc diff --git a/prdoc/pr_4956.prdoc b/prdoc/pr_4956.prdoc new file mode 100644 index 000000000000..8bcd292526af --- /dev/null +++ b/prdoc/pr_4956.prdoc @@ -0,0 +1,34 @@ +crates: +- name: people-rococo-runtime + validate: false +- name: people-westend-runtime + validate: false +- name: rococo-parachain-runtime + validate: false +- name: asset-hub-rococo-runtime + validate: false +- name: asset-hub-westend-runtime + validate: false +- name: bridge-hub-rococo-runtime + validate: false +- name: bridge-hub-westend-runtime + validate: false +- name: collectives-westend-runtime + validate: false +- name: contracts-rococo-runtime + validate: false +- name: coretime-rococo-runtime + validate: false +- name: coretime-westend-runtime + validate: false +- name: glutton-westend-runtime + validate: false +- name: rococo-runtime + validate: false +- name: westend-runtime + validate: false +doc: +- audience: TODO + description: "This PR adds possibility to set BUILD_OPTIONS to the \"Srtool Build\"\ + \ step in the release pipeline while building runtimes.\r\n\r\nColses: https://github.com/paritytech/release-engineering/issues/213" +title: Add build options to the srtool build step From e48b99d1b4e2039374e80caf357dd52c66261bed Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Mon, 26 Aug 2024 12:48:08 +0200 Subject: [PATCH 14/14] update prdoc --- prdoc/pr_4956.prdoc | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/prdoc/pr_4956.prdoc b/prdoc/pr_4956.prdoc index 8bcd292526af..a72ca303aaca 100644 --- a/prdoc/pr_4956.prdoc +++ b/prdoc/pr_4956.prdoc @@ -1,34 +1,39 @@ +title: Add build options to the srtool build step and delete `disanle-logging` feature + +doc: +- audience: Runtime Dev + description: | + This PR adds possibility to set BUILD_OPTIONS to the "Srtool Build\" step in the release pipeline while building runtimes. + And deletes the `disable-logging` feature from test runtimes to be able to build those with an activated logging. + + + crates: - name: people-rococo-runtime - validate: false + bump: patch - name: people-westend-runtime - validate: false + bump: patch - name: rococo-parachain-runtime - validate: false + bump: patch - name: asset-hub-rococo-runtime - validate: false + bump: patch - name: asset-hub-westend-runtime - validate: false + bump: patch - name: bridge-hub-rococo-runtime - validate: false + bump: patch - name: bridge-hub-westend-runtime - validate: false + bump: patch - name: collectives-westend-runtime - validate: false + bump: patch - name: contracts-rococo-runtime - validate: false + bump: patch - name: coretime-rococo-runtime - validate: false + bump: patch - name: coretime-westend-runtime - validate: false + bump: patch - name: glutton-westend-runtime - validate: false + bump: patch - name: rococo-runtime - validate: false + bump: patch - name: westend-runtime - validate: false -doc: -- audience: TODO - description: "This PR adds possibility to set BUILD_OPTIONS to the \"Srtool Build\"\ - \ step in the release pipeline while building runtimes.\r\n\r\nColses: https://github.com/paritytech/release-engineering/issues/213" -title: Add build options to the srtool build step + bump: patch