|
11 | 11 |
|
12 | 12 | DOCKER_REGISTRY: ghcr.io
|
13 | 13 |
|
14 |
| - GOMPLATE_VERSION: v3.11.6 |
| 14 | + GOMPLATE_VERSION: v4.3.1 |
15 | 15 | GOMPLATE: gomplate_linux-amd64
|
16 | 16 | GOMPLATE_URL: https://github.com/hairyhenderson/gomplate/releases/download
|
17 | 17 |
|
18 | 18 | RUST_BACKTRACE: full
|
19 |
| - RUST_TOOLCHAIN: 1.74.0 |
20 | 19 |
|
21 | 20 | # Set this to true for CI testing purposes only.
|
22 | 21 | SKIP_BUILD: false
|
@@ -92,44 +91,56 @@ jobs:
|
92 | 91 | zstd -d wuh.zst
|
93 | 92 | chmod u+x ./wuh
|
94 | 93 | sudo mv ./wuh /usr/bin/wuh
|
95 |
| - - name: Build ${{ matrix.runtime }} runtime |
96 |
| - id: srtool_build |
97 |
| - if: ${{ env.SKIP_BUILD != 'true' }} |
98 |
| - |
99 |
| - env: |
100 |
| - BUILD_OPTS: --features=on-chain-release-build |
| 94 | + - name: Build runtime |
| 95 | + # It is recommended to use a specific version of the action in production. |
| 96 | + # |
| 97 | + # For example: |
| 98 | + # uses: hack-ink/polkadot-runtime-releaser/action/[email protected] |
| 99 | + uses: hack-ink/polkadot-runtime-releaser/action/build@v0.2.0 |
101 | 100 | with:
|
102 |
| - image: paritytech/srtool |
103 |
| - tag: "1.74.0" |
104 |
| - chain: ${{ matrix.runtime }} |
| 101 | + # The target runtime to build. |
| 102 | + # |
| 103 | + # For example, `polkadot-runtime` or `staging-kusama-runtime`. |
| 104 | + runtime: ${{ matrix.runtime }}-runtime |
| 105 | + # The features to enable for this release build. |
| 106 | + # |
| 107 | + # Generally, this would be `on-chain-release-build` in order to disable the logging to shrink the WASM binary size. |
| 108 | + features: on-chain-release-build |
| 109 | + # Rust toolchain version to build the runtime. |
| 110 | + toolchain-ver: 1.81.0 |
| 111 | + # The workdir to build the runtime. |
| 112 | + # |
| 113 | + # By default, it is current directory. |
| 114 | + # workdir: . |
| 115 | + # The output directory of the WASM binary. |
| 116 | + output-dir: . |
105 | 117 | - name: Prepare runtime
|
106 | 118 | run: |
|
107 | 119 | SKIP_BUILD=${{ env.SKIP_BUILD }}
|
108 | 120 |
|
109 |
| - export CHAIN=${{ matrix.runtime }} |
110 |
| -
|
111 |
| - echo $CHAIN |
| 121 | + # Template will use this env var. |
| 122 | + export RUNTIME=${{ matrix.runtime }} |
112 | 123 |
|
113 | 124 | mkdir -p build
|
114 | 125 |
|
115 | 126 | if [ "$SKIP_BUILD" == "true" ]; then
|
116 |
| - echo SKIP_BUILD > build/${CHAIN}-srtool.json |
117 |
| - echo SKIP_BUILD > build/${CHAIN}_runtime.compact.compressed.wasm |
| 127 | + echo SKIP_BUILD > build/${RUNTIME}.wasm |
118 | 128 | echo SKIP_BUILD > build/runtime.md
|
119 | 129 | else
|
120 |
| - echo '${{ steps.srtool_build.outputs.json }}' | jq > build/${CHAIN}-srtool.json |
121 |
| -
|
122 |
| - WASM_FILE='${{ steps.srtool_build.outputs.wasm_compressed }}' |
123 | 130 | WHITELIST_PALLET_INDEX=0x33
|
124 |
| - if [ "$CHAIN" == "crab" ]; then |
| 131 | + if [ "$RUNTIME" == "crab" ]; then |
125 | 132 | WHITELIST_PALLET_INDEX=0x2f
|
126 | 133 | fi
|
127 |
| - export WHITELIST_HASH=$(wuh ${WASM_FILE} ${WHITELIST_PALLET_INDEX} 0x01) |
| 134 | + WASM=$(ls ${RUNTIME}*.wasm) |
| 135 | + # Template will use this env var. |
| 136 | + export WHITELIST_HASH=$(wuh ${WASM} ${WHITELIST_PALLET_INDEX} 0x01) |
| 137 | +
|
| 138 | + mv ${WASM} build/ |
128 | 139 |
|
129 |
| - mv ${WASM_FILE} build/ |
| 140 | + DIGEST=$(ls ${RUNTIME}*.json) |
130 | 141 |
|
131 | 142 | cat .github/note-template/runtime.md \
|
132 |
| - | gomplate -d srtool=build/${CHAIN}-srtool.json \ |
| 143 | + | gomplate -d prr=${DIGEST} \ |
133 | 144 | > build/runtime.md
|
134 | 145 | fi
|
135 | 146 | - name: Upload ${{ matrix.runtime }} runtime
|
@@ -199,7 +210,6 @@ jobs:
|
199 | 210 | - name: Prepare nodes and runtimes
|
200 | 211 | run: |
|
201 | 212 | mkdir -p deploy
|
202 |
| - mv *runtime/*.json deploy/ |
203 | 213 | mv *runtime/*.wasm deploy/
|
204 | 214 | mv darwinia/*.tar.* deploy/
|
205 | 215 | mv darwinia-tracing/*.tar.* deploy/
|
|
0 commit comments