Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build options to the srtool build step #4956

Merged
merged 24 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
df3922d
add runtimes build options to srtool build
EgorPopelyaev Jun 27, 2024
f611426
add srtool build with options
EgorPopelyaev Jul 5, 2024
a45ad83
add additional step to set build options
EgorPopelyaev Jul 5, 2024
8b4b2f2
add qoutes
EgorPopelyaev Jul 5, 2024
defe4a4
change scope of BUILD_OPTIONS
EgorPopelyaev Jul 5, 2024
8b08e5f
chaneg build optas and add a job to build runtimes with logging activ…
EgorPopelyaev Jul 8, 2024
79d3474
add on-chain-release-build feature to where it is missing
EgorPopelyaev Jul 9, 2024
aca9c75
Merge branch 'master' into ep-add-build-opts-to-release
EgorPopelyaev Jul 9, 2024
213574f
add upload runtiems without logging
EgorPopelyaev Jul 9, 2024
1ccbc2a
change call of the env
EgorPopelyaev Jul 9, 2024
6ad1e29
hardcode suffix as reusable workflow does not parse env
EgorPopelyaev Jul 9, 2024
8698c39
adjust path to release-notes-context.json
EgorPopelyaev Jul 10, 2024
9c02c32
Merge branch 'master' into ep-add-build-opts-to-release
bkchr Jul 17, 2024
9d236b7
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Jul 31, 2024
75720f7
Merge branch 'ep-add-build-opts-to-release' of https://github.com/Ego…
EgorPopelyaev Jul 31, 2024
cff9c73
delete `disable-logging` and adjust flow to build runtimes only one time
EgorPopelyaev Jul 31, 2024
063cba0
Merge branch 'master' into ep-add-build-opts-to-release
EgorPopelyaev Aug 6, 2024
26da67b
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Aug 12, 2024
9942d15
Merge branch 'ep-add-build-opts-to-release' of https://github.com/Ego…
EgorPopelyaev Aug 12, 2024
df7bf5a
Merge branch 'master' into ep-add-build-opts-to-release
EgorPopelyaev Aug 12, 2024
d7cf048
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Aug 22, 2024
6b9d737
Add PrDoc (auto generated)
EgorPopelyaev Aug 22, 2024
de219c9
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Aug 26, 2024
e48b99d
update prdoc
EgorPopelyaev Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Release - Publish draft

env:
LOGGING_NAME_SUFFIX: "logging"

on:
push:
tags:
Expand All @@ -26,6 +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 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: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't enable the on-chain-release-build feature. This means that metadata hash will not be generated at compile time. This is bad 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this one was done only for the case to have the logging enabled. In theory, this step should go away if the disable-logging feature will be deleted from the on-chain-release-build as we discussed above. If it is ok, I can delete it as part of this PR, and then we will have only the one build with the on-chain-release-build feature activated.

name_suffix: "-logging"

build-binaries:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -156,6 +168,38 @@ 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
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release-srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
inputs:
excluded_runtimes:
type: string
build_opts:
type: string
name_suffix:
type: string
outputs:
published_runtimes:
value: ${{ jobs.find-runtimes.outputs.runtime }}
Expand Down Expand Up @@ -74,6 +78,8 @@ jobs:
- name: Srtool build
id: srtool_build
uses: chevdor/[email protected]
env:
BUILD_OPTS: ${{ inputs.build_opts }}
with:
chain: ${{ matrix.chain }}
runtime_dir: ${{ matrix.runtime_dir }}
Expand Down Expand Up @@ -117,7 +123,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
Expand Down
5 changes: 5 additions & 0 deletions cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,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 = []
5 changes: 5 additions & 0 deletions cumulus/parachains/runtimes/people/people-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,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 = []
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,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 = []
Loading