Build for main #160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Manual Build | |
| run-name: Build for ${{ github.event.inputs.ref }} | |
| env: | |
| SUBWASM_VERSION: 0.21.0 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| srtool_tag: | |
| description: The SRTOOL tag to use | |
| default: 1.88.0 | |
| required: false | |
| srtool_image: | |
| description: The SRTOOL image to use | |
| default: paritytech/srtool | |
| required: false | |
| chain: | |
| description: The chain to use | |
| default: westend-runtime | |
| required: false | |
| package: | |
| description: The package to be used | |
| default: westend-runtime | |
| required: true | |
| repository: | |
| description: The repository to be used | |
| default: paritytech/polkadot-sdk | |
| required: true | |
| runtime_dir: | |
| description: The runtime_dir to be used | |
| default: polkadot/runtime/westend | |
| required: true | |
| ref: | |
| 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) | |
| required: false | |
| profile: | |
| description: The profile to be used for the runtime build | |
| default: release | |
| required: false | |
| jobs: | |
| build: | |
| name: Build ${{ github.event.inputs.repository }}/${{ github.event.inputs.package }} ${{ github.event.inputs.ref }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
| with: | |
| repository: ${{ github.event.inputs.repository }} | |
| ref: ${{ github.event.inputs.ref }} | |
| fetch-depth: 0 | |
| - name: Srtool build | |
| id: srtool_build | |
| uses: chevdor/[email protected] | |
| 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 }}" | |
| # 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@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 |