Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-09-12
toolchain: nightly-2021-11-07
components: rustfmt
target: wasm32-unknown-unknown
default: true
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Srtool build

env:
SUBWASM_VERSION: 0.15.0
SRTOOL_TAG: 1.56.1

on:
workflow_dispatch:
inputs:
srtool_tag:
description: The SRTOOL tag to use
# keep the same as `env.SRTOOL_TAG`
default: 1.56.1
required: false
ref:
description: The ref to be used for the repo
default: master
required: false

jobs:
build:
name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref || github.ref }}
strategy:
matrix:
chain: ["bifrost"]
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
submodules: true

- name: Srtool build
id: srtool_build
uses: chevdor/[email protected]
with:
chain: ${{ matrix.chain }}
tag: ${{ github.event.inputs.srtool_tag || env.SRTOOL_TAG }}

- 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@v2
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: Check the metadata diff
run: |
subwasm get wss://bifrost-rpc.liebi.com/ws --output runtime_mainnet.wasm
subwasm diff ${{ steps.srtool_build.outputs.wasm }} runtime_mainnet.wasm | tee ${{ matrix.chain }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-info_compressed.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt
4 changes: 2 additions & 2 deletions .maintain/build-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -xe

RUSTC_VERSION="1.53.0"
RUSTC_VERSION="1.56.1"
EXTRA_ARGS='--json'
BIN_PATH=$(dirname $(readlink -f $0))
WORK_PATH=${BIN_PATH}/..
Expand All @@ -18,5 +18,5 @@ docker run --rm -it \
paritytech/srtool:${RUSTC_VERSION} build ${EXTRA_ARGS}

mkdir -p ${WORK_PATH}/deploy/wasm
cp ${WORK_PATH}/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.wasm \
cp ${WORK_PATH}/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.compressed.wasm \
${WORK_PATH}/deploy/wasm
5 changes: 0 additions & 5 deletions rust-toolchain.toml

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e

echo "*** Initializing WASM build environment"

rustup default nightly-2021-09-12
rustup default nightly-2021-11-07

rustup target add wasm32-unknown-unknown --toolchain nightly-2021-09-12
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-11-07