170 Call Gitlab CI job to Automate Runtime Release #1
Workflow file for this run
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: | |
pull_request: | |
types: [opened, edited, synchronize] | |
branches: | |
- main | |
jobs: | |
build: | |
if: "contains(github.event.pull_request.title, 'Release')" | |
name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref }} | |
strategy: | |
fail-fast: false | |
matrix: | |
chain: ["amplitude", "pendulum"] | |
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] | |
with: | |
chain: ${{ matrix.chain }} | |
runtime_dir: runtime/${{ matrix.chain }} | |
# this is important to avoid build fail. See https://github.com/paritytech/srtool/issues/62 | |
tag: 1.66.1 | |
- 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 |