44 push :
55 tags :
66 - " v*"
7- - " koi*"
87
98env :
109 CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
2019 RUST_TOOLCHAIN : 1.74.0
2120
2221 # Set this to true for CI testing purposes only.
23- # SKIP_BUILD: true
22+ SKIP_BUILD : false
2423
2524jobs :
2625 build-nodes :
2928 strategy :
3029 matrix :
3130 node :
32- - network : mainnet
33- features : darwinia-runtime,crab-runtime
31+ - features : darwinia-runtime,crab-runtime
3432 bz2 : true
35- - network : mainnet
36- features : darwinia-runtime,crab-runtime,evm-tracing
37- type : tracing
38- - network : testnet
39- features : koi-runtime
40- bz2 : true
41- - network : testnet
42- features : koi-runtime,evm-tracing
33+ - features : darwinia-runtime,crab-runtime,evm-tracing
4334 type : tracing
4435 steps :
4536 - name : Free disk space
6051 swap-size-gb : 8
6152 - name : Fetch latest code
6253 uses : actions/checkout@v4
63- - name : Build mainnet node
64- if : ${{ startsWith(github.ref, 'refs/tags/v') && (matrix.node.network == 'mainnet') }}
65- uses : ./.github/actions/build
66- with :
67- features : ${{ matrix.node.features }}
68- suffix : ${{ matrix.node.type }}
69- enable_tar_bz2 : ${{ matrix.node.bz2 }}
70- skip-build : ${{ env.SKIP_BUILD }}
71- - name : Build testnet node
72- if : ${{ startsWith(github.ref, 'refs/tags/koi') && (matrix.node.network == 'testnet') }}
54+ - name : Build node
7355 uses : ./.github/actions/build
7456 with :
7557 features : ${{ matrix.node.features }}
9577 runs-on : ubuntu-latest
9678 strategy :
9779 matrix :
98- runtime :
99- - name : darwinia
100- type : mainnet
101- - name : crab
102- type : mainnet
103- - name : koi
104- type : testnet
80+ runtime : [darwinia, crab]
10581 steps :
10682 - name : Fetch latest code
10783 uses : actions/checkout@v4
@@ -116,19 +92,7 @@ jobs:
11692 zstd -d wuh.zst
11793 chmod u+x ./wuh
11894 sudo mv ./wuh /usr/bin/wuh
119- - name : Filter
120- run : |
121- SKIP_BUILD=${{ env.SKIP_BUILD }}
122- IS_MAINNET=${{ matrix.runtime.type == 'mainnet' && startsWith(github.ref, 'refs/tags/v') }}
123- IS_TESTNET=${{ matrix.runtime.type == 'testnet' && startsWith(github.ref, 'refs/tags/koi') }}
124-
125- echo "IS_MAINNET='$IS_MAINNET'" >> $GITHUB_ENV
126- echo "IS_TESTNET='$IS_TESTNET'" >> $GITHUB_ENV
127-
128- if [[ "$SKIP_BUILD" != "true" && ( "$IS_MAINNET" == "true" || "$IS_TESTNET" == "true" ) ]] ; then
129- echo "FILTER=true" >> $GITHUB_ENV
130- fi
131- - name : Build ${{ matrix.runtime.name }} runtime
95+ - name : Build ${{ matrix.runtime }} runtime
13296 id : srtool_build
13397 if : ${{ env.FILTER == 'true' }}
13498 uses : chevdor/srtool-actions@v0.9.2
@@ -137,20 +101,22 @@ jobs:
137101 with :
138102 image : paritytech/srtool
139103 tag : " 1.74.0"
140- chain : ${{ matrix.runtime.name }}
104+ chain : ${{ matrix.runtime }}
141105 - name : Prepare runtime
142106 run : |
143- IS_MAINNET=${{ env.IS_MAINNET }}
144- IS_TESTNET=${{ env.IS_TESTNET }}
145- FILTER=${{ env.FILTER }}
107+ SKIP_BUILD=${{ env.SKIP_BUILD }}
146108
147- export CHAIN=${{ matrix.runtime.name }}
109+ export CHAIN=${{ matrix.runtime }}
148110
149111 echo $CHAIN
150112
151113 mkdir -p build
152114
153- if [ "$FILTER" == "true" ]; then
115+ if [ "$SKIP_BUILD" == "true" ]; then
116+ echo SKIP_BUILD > build/${CHAIN}-srtool.json
117+ echo SKIP_BUILD > build/${CHAIN}_runtime.compact.compressed.wasm
118+ echo SKIP_BUILD > build/runtime.md
119+ else
154120 echo '${{ steps.srtool_build.outputs.json }}' | jq > build/${CHAIN}-srtool.json
155121
156122 WASM_FILE='${{ steps.srtool_build.outputs.wasm_compressed }}'
@@ -165,15 +131,11 @@ jobs:
165131 cat .github/note-template/runtime.md \
166132 | gomplate -d srtool=build/${CHAIN}-srtool.json \
167133 > build/runtime.md
168- elif [[ "$IS_MAINNET" == "true" || "$IS_TESTNET" == "true" ]]; then
169- echo SKIP_BUILD > build/${CHAIN}-srtool.json
170- echo SKIP_BUILD > build/${CHAIN}_runtime.compact.compressed.wasm
171- echo SKIP_BUILD > build/runtime.md
172134 fi
173- - name : Upload ${{ matrix.runtime.name }} runtime
135+ - name : Upload ${{ matrix.runtime }} runtime
174136 uses : actions/upload-artifact@v4
175137 with :
176- name : ${{ matrix.runtime.name }}-runtime
138+ name : ${{ matrix.runtime }}-runtime
177139 path : build
178140 retention-days : 1
179141 - name : Fail fast
@@ -258,16 +220,9 @@ jobs:
258220 > node.tmp.md
259221 - name : Fill note
260222 run : |
261- IS_MAINNET=${{ startsWith(github.ref, 'refs/tags/v') }}
262-
263- if [ "$IS_MAINNET" == "true" ]; then
264- cat darwinia-runtime/runtime.md >> node.md
265- cat crab-runtime/runtime.md >> node.md
266- cat node.tmp.md >> node.md
267- else
268- cat koi-runtime/runtime.md >> node.md
269- cat node.tmp.md >> node.md
270- fi
223+ cat darwinia-runtime/runtime.md >> node.md
224+ cat crab-runtime/runtime.md >> node.md
225+ cat node.tmp.md >> node.md
271226 - name : Hash file
272227 run : cd deploy && sha256sum * | tee sha256sums.txt
273228 # - name: Verify
@@ -284,4 +239,3 @@ jobs:
284239 deploy/*
285240 generate_release_notes : true
286241 token : ${{ secrets.GITHUB_TOKEN }}
287- prerelease : ${{ startsWith(github.ref, 'refs/tags/koi') }}
0 commit comments