Srtool build #196
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: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
tags: | |
- 'v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+' | |
jobs: | |
build: | |
name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref || github.ref_name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
chain: ["bifrost-kusama", "bifrost-polkadot"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: "📥 Checkout" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref || github.ref }} | |
fetch-depth: 1 | |
- name: "🏗️ Build Runtime" | |
id: srtool_build | |
uses: chevdor/[email protected] | |
env: | |
BUILD_OPTS: "--features on-chain-release-build" | |
with: | |
profile: production | |
chain: ${{ matrix.chain }} | |
runtime_dir: runtime/${{ matrix.chain }} | |
- 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 }}" | |
cp ${{ steps.srtool_build.outputs.wasm_compressed }} ./${{ matrix.chain }}_runtime.compact.compressed.wasm | |
- 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: "🔍 Get Runtime information" | |
id: runtime_info | |
run: | | |
echo "compressed_info<<EOF" >> $GITHUB_OUTPUT | |
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
subwasm info ${{ steps.srtool_build.outputs.wasm }} | |
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} | |
subwasm meta ${{ steps.srtool_build.outputs.wasm }} | |
subwasm info ${{ steps.srtool_build.outputs.wasm }} > runtime_info.txt | |
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} >> runtime_info.txt | |
- name: Archive Artifacts for ${{ matrix.chain }} | |
id: upload_artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.chain }}-runtime-${{ github.event.inputs.ref || github.ref_name }} | |
path: | | |
${{ matrix.chain }}_runtime.compact.compressed.wasm | |
${{ matrix.chain }}-srtool-digest.json | |
runtime_info.txt | |
- uses: 8398a7/action-slack@v3 | |
name: "Send Slack Notification" | |
if: success() | |
with: | |
status: custom | |
fields: workflow,job,commit,repo,ref,author,took | |
custom_payload: | | |
{ | |
"attachments": [{ | |
"color": "good", | |
"text": ":rocket: New runtime build for ${{ matrix.chain }} (${{ github.event.inputs.ref || github.ref_name }})\nDownload artifacts: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload_artifacts.outputs.artifact-id }}" | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
- name: Debug Trigger | |
run: | | |
echo "github.ref: ${{ github.ref }}" | |
echo "github.ref_name: ${{ github.ref_name }}" | |
echo "github.event_name: ${{ github.event_name }}" | |
echo "github.action: ${{ github.action }}" | |