-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
aa2e388
commit 491eee4
Showing
1 changed file
with
29 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,26 +6,22 @@ env: | |
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 }} | ||
name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
chain: ["bifrost-kusama", "bifrost-polkadot"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "📥 Checkout" | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.ref || github.ref }} | ||
fetch-depth: 1 | ||
ref: ${{ github.event.inputs.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: "🏗️ Build Runtime" | ||
- name: Srtool build | ||
id: srtool_build | ||
uses: chevdor/[email protected] | ||
env: | ||
|
@@ -34,63 +30,45 @@ jobs: | |
profile: production | ||
chain: ${{ matrix.chain }} | ||
runtime_dir: runtime/${{ matrix.chain }} | ||
|
||
- name: "🔍 Summary" | ||
- 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 | ||
# it takes a while to build the runtime, so let's save the artifact as soon as we have it | ||
- name: Archive Artifacts for ${{ matrix.chain }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.chain }}-runtime | ||
path: | | ||
${{ steps.srtool_build.outputs.wasm }} | ||
${{ steps.srtool_build.outputs.wasm_compressed }} | ||
${{ matrix.chain }}-srtool-digest.json | ||
# We now get extra information thanks to subwasm, | ||
- 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 | ||
- name: Show Runtime information | ||
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 --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 | ||
run: | | ||
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 | ||
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json | ||
- name: Archive Artifacts for ${{ matrix.chain }} | ||
id: upload_artifacts | ||
- name: Archive Subwasm results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.chain }}-runtime-${{ github.event.inputs.ref || github.ref_name }} | ||
name: ${{ matrix.chain }}-runtime-${{ github.sha }} | ||
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 }}" | ||
${{ matrix.chain }}-info.json | ||
${{ matrix.chain }}-info_compressed.json | ||
${{ matrix.chain }}-metadata.json | ||
${{ matrix.chain }}-diff.txt |