-
Notifications
You must be signed in to change notification settings - Fork 13
96 lines (85 loc) · 3.73 KB
/
runtime-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build Runtime
env:
SRTOOL_IMG: paritytech/srtool
SRTOOL_VERSION: 1.57.0
SUBWASM_VERSION: 0.16.1
on:
workflow_run:
workflows: ["Build Binaries"]
branches: [master]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
srtool_image:
description: The srtool image to use
default: paritytech/srtool
required: false
srtool_version:
description: The srtool version to use
required: false
subwasm_version:
description: The subwasm version to use
required: false
jobs:
srtool:
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["opportunity", "standard"]
steps:
- name: Checkout - ${{ matrix.chain }}
uses: actions/checkout@v2
with:
submodules: true
- name: Runtime build - ${{ matrix.chain }}
id: srtool_build
uses: chevdor/srtool-actions@master
with:
image: ${{ github.event.inputs.srtool_image || env.SRTOOL_IMG }}
tag: ${{ github.event.inputs.srtool_version || env.SRTOOL_VERSION }}
chain: ${{ matrix.chain }}
# workdir: "${{ github.workspace }}"
# runtime_dir: "runtime/${{ matrix.chain }}"
- name: Install subwasm - ${{ matrix.chain }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ github.event.inputs.subwasm_version || env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ github.event.inputs.subwasm_version || env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ github.event.inputs.subwasm_version || env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Show Runtime information - ${{ matrix.chain }}
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 - ${{ matrix.chain }}
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 - ${{ matrix.chain }}
run: |
# subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} | tee ${{ matrix.chain }}-diff.txt
echo "No live chain to compare" > ${{ matrix.chain }}-diff.txt
- name: srtool Summary - ${{ matrix.chain }}
run: |
echo Summary:
echo - version: ${{ steps.srtool_build.outputs.version }}
echo - info: ${{ steps.srtool_build.outputs.info }}
echo - prop: ${{ steps.srtool_build.outputs.proposal_hash }}
echo - json: ${{ steps.srtool_build.outputs.json }}
echo - location: ${{ steps.srtool_build.outputs.wasm }}
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.chain }}-srtool-digest.json
cat ${{ matrix.chain }}-srtool-digest.json
- name: Archive srtool/subwasm results - ${{ matrix.chain }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime-${{ github.sha }}
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.chain }}-srtool-digest.json
${{ matrix.chain }}-info.json
${{ matrix.chain }}-info_compressed.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt