diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 83f4671d8..7e5e923ac 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -55,14 +55,10 @@ jobs: echo '${{ secrets.RUNNER_PASSWORD }}' | sudo -S chown -R $USER:$USER $GITHUB_WORKSPACE echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} - uses: actions/checkout@v3 - - name: Build runtime using "${{ matrix.srtool_image }}:${{ matrix.srtool_image_tag }}" + - name: Srtool build id: srtool_build - env: - GH_WORKFLOW_MATRIX_CHAIN: ${{ matrix.chain }} - GH_WORKFLOW_MATRIX_SRTOOL_IMAGE: ${{ matrix.srtool_image }} - GH_WORKFLOW_MATRIX_SRTOOL_IMAGE_TAG: ${{ matrix.srtool_image_tag }} run: | - make wasm + make RUNTIME=${{ matrix.chain }}-runtime wasm - name: Summary run: | echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json diff --git a/scripts/srtool-build.sh b/scripts/srtool-build.sh index 9e4862dca..5e2677f50 100755 --- a/scripts/srtool-build.sh +++ b/scripts/srtool-build.sh @@ -10,11 +10,36 @@ RUSTC_VERSION=1.62.0; PACKAGE=${PACKAGE:-vanilla-runtime}; BUILD_OPTS=$BUILD_OPTS; -docker run --rm -i \ - -e PACKAGE=$PACKAGE \ - -e BUILD_OPTS="$BUILD_OPTS" \ - -v $PWD:/build \ - -v $TMPDIR/cargo:/cargo-home \ +CMD="docker run \ + -i \ + --rm \ + -e PACKAGE=${PACKAGE} \ + -e BUILD_OPTS="${BUILD_OPTS}" \ + -v ${PWD}:/build \ + -v ${TMPDIR}/cargo:/cargo-home \ --user root \ --network=host \ - paritytech/srtool:$RUSTC_VERSION + paritytech/srtool:${RUSTC_VERSION} \ + build --app --json -cM" + +stdbuf -oL $CMD | { + while IFS= read -r line + do + echo ║ $line + JSON="$line" + done + + echo ::set-output name=json::$JSON + + PROP=`echo $JSON | jq -r .runtimes.compact.prop` + echo ::set-output name=proposal_hash::$PROP + + WASM=`echo $JSON | jq -r .runtimes.compact.wasm` + echo ::set-output name=wasm::$WASM + + Z_WASM=`echo $JSON | jq -r .runtimes.compressed.wasm` + echo ::set-output name=wasm_compressed::$Z_WASM + + IPFS=`echo $JSON | jq -r .runtimes.compact.ipfs` + echo ::set-output name=ipfs::$IPFS +} \ No newline at end of file