Publish Release #40
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: Publish Release | |
# This script is used to build and publish the release WASM build of runtime: | |
# - Checkout the selected branch | |
# - Build WASM using Substrate Runtime Tool | |
env: | |
SUBWASM_VERSION: 0.20.0 | |
on: | |
workflow_dispatch: | |
inputs: | |
# Get name of the chain | |
chain: | |
description: Chain Runtime (default = pioneer) | |
required: true | |
default: pioneer | |
type: choice | |
options: | |
- metaverse | |
- pioneer | |
- continuum | |
# Get the SR Tool image used to build | |
srtool_image: | |
description: Default to use the latest. You can use an alternate image, use with caution! | |
required: false | |
jobs: | |
srtool: | |
name: Build and publish ${{ github.event.inputs.chain }} | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the Bit.Country codebase | |
- name: Checkout Codebase | |
uses: actions/checkout@v3 | |
# Build WASM with Substrate Runtime Tool | |
- name: Srtool build | |
id: srtool_build | |
uses: chevdor/[email protected] | |
with: | |
chain: ${{ github.event.inputs.chain }} | |
tag: ${{ github.event.inputs.srtool_image }} | |
# Output the build summary | |
- name: Build 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 }}" | |
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}" | |
# install 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 | |
# Display information for wasm | |
- name: Extract metadata | |
run: | | |
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.json | |
subwasm info ${{ steps.srtool_build.outputs.wasm }} > ${{ github.event.inputs.chain }}-info.txt | |
cat ${{ github.event.inputs.chain }}-info.txt | |
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-subwam-info.json | |
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ github.event.inputs.chain }}-subwam-info.txt | |
cat ${{ github.event.inputs.chain }}-subwam-info.txt | |
# Diff new wasm with current | |
- 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 | |
# 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@v3 | |
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 | |
${{ github.event.inputs.chain }}-metadata.json | |
${{ github.event.inputs.chain }}-metadata.txt | |
${{ github.event.inputs.chain }}-subwam-info.json | |
${{ github.event.inputs.chain }}-subwam-info.txt | |
${{ github.event.inputs.chain }}-diff.txt | |