Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh action: system parachains wasm #99

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/build-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,40 @@ jobs:
contents: write
strategy:
matrix:
runtime: ["paseo"]
runtime:
- name: "paseo"
path: "relay/paseo"
- name: "asset-hub-paseo"
path: "system-parachains/asset-hub-paseo"
- name: "bridge-hub-paseo"
path: "system-parachains/bridge-hub-paseo"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache runtime target dir
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/runtime/${{ matrix.runtime }}/target"
key: srtool-target-${{ matrix.runtime }}-${{ github.sha }}
path: "${{ github.workspace }}/runtime/${{ matrix.runtime.name }}/target"
key: srtool-target-${{ matrix.runtime.name }}-${{ github.sha }}
restore-keys: |
srtool-target-${{ matrix.runtime }}-
srtool-target-${{ matrix.runtime.name }}-
srtool-target-

- name: Build ${{ matrix.runtime }} runtime
- name: Build ${{ matrix.runtime.name }} runtime
id: srtool_build
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features on-chain-release-build"
with:
chain: ${{ matrix.runtime }}
package: "paseo-runtime"
runtime_dir: "relay/paseo"
chain: ${{ matrix.runtime.name }}
package: "${{ matrix.runtime.name }}-runtime"
runtime_dir: ${{ matrix.runtime.path }}
profile: "production"

- name: Store srtool digest to disk
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.runtime }}-srtool-digest.json
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.runtime.name }}-srtool-digest.json

# Manual trigger: add artifacts to run
- name: Copy artifacts
Expand All @@ -49,10 +55,10 @@ jobs:
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runtime }}-runtime-${{ github.sha }}
name: ${{ matrix.runtime.name }}-runtime-${{ github.sha }}
path: |
${{ matrix.chain }}*.wasm
${{ matrix.runtime }}-srtool-digest.json
${{ matrix.runtime.name }}*.wasm
${{ matrix.runtime.name }}-srtool-digest.json

# Release published: add artifacts to release
- name: Add artifacts to release
Expand All @@ -61,7 +67,7 @@ jobs:
with:
append_body: true
body: |
## Runtime: `${{ matrix.runtime }}`
## Runtime: `${{ matrix.runtime.name }}`
```
🏋️ Runtime Size: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.size }} bytes
🔥 Core Version: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.core_version.specName }}-${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.core_version.specVersion }}
Expand All @@ -73,4 +79,4 @@ jobs:
```
files: |
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.runtime }}-srtool-digest.json
${{ matrix.runtime.name }}-srtool-digest.json