Srtool build #179
This file contains 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: Srtool build | |
env: | |
SUBWASM_VERSION: 0.20.0 | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build: | |
name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref }} | |
strategy: | |
fail-fast: false | |
matrix: | |
chain: ["bifrost-kusama", "bifrost-polkadot"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
fetch-depth: 0 | |
- name: Srtool build | |
id: srtool_build | |
uses: chevdor/[email protected] | |
env: | |
BUILD_OPTS: "--features on-chain-release-build" | |
PARACHAIN_PALLET_ID: "0x05" | |
AUTHORIZE_UPGRADE_PREFIX: "0x02" | |
with: | |
chain: ${{ matrix.chain }} | |
runtime_dir: runtime/${{ matrix.chain }} | |
- name: Summary | |
run: | | |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json | |
cat ${{ matrix.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 ${{ matrix.chain }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.chain }}-runtime | |
path: | | |
${{ steps.srtool_build.outputs.wasm }} | |
${{ steps.srtool_build.outputs.wasm_compressed }} | |
${{ matrix.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 }} > ${{ matrix.chain }}-info.json | |
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-info_compressed.json | |
- name: Extract the metadata | |
run: | | |
subwasm meta ${{ steps.srtool_build.outputs.wasm }} | |
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json | |
- name: Archive Subwasm results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.chain }}-runtime-${{ github.sha }} | |
path: | | |
${{ matrix.chain }}-info.json | |
${{ matrix.chain }}-info_compressed.json | |
${{ matrix.chain }}-metadata.json | |
${{ matrix.chain }}-diff.txt |