Skip to content

Added live network test support for Westend bulletin chain (#216) #19

Added live network test support for Westend bulletin chain (#216)

Added live network test support for Westend bulletin chain (#216) #19

Workflow file for this run

name: Release
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
build-runtimes:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: bulletin-westend
package: bulletin-westend-runtime
path: runtimes/bulletin-westend
- name: bulletin-paseo
package: bulletin-westend-runtime
path: runtimes/bulletin-westend
- name: bulletin-polkadot
package: bulletin-polkadot-runtime
path: runtimes/bulletin-polkadot
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build ${{ matrix.name }} runtime
id: srtool_build
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features on-chain-release-build"
with:
chain: ${{ matrix.name }}
package: ${{ matrix.package }}
runtime_dir: ${{ matrix.path }}
profile: production
- name: Store srtool digest
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.name }}_srtool_output.json
- name: Upload ${{ matrix.name }} wasm
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.name }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.name }}_srtool_output.json
build-node:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: polkadot-bulletin-chain-linux
- os: macos-14
target: aarch64-apple-darwin
artifact_name: polkadot-bulletin-chain-macos-aarch64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rust-src
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
sudo apt-get install -y protobuf-compiler libclang-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install protobuf llvm
LLVM_PATH=$(brew --prefix llvm)
echo "LIBCLANG_PATH=$LLVM_PATH/lib" >> $GITHUB_ENV
echo "LDFLAGS=-L$LLVM_PATH/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$LLVM_PATH/include" >> $GITHUB_ENV
- name: Build polkadot-bulletin-chain binary
run: cargo build --profile production -p polkadot-bulletin-chain
- name: Upload polkadot-bulletin-chain binary
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact_name }}
path: target/production/polkadot-bulletin-chain
publish-release:
runs-on: ubuntu-latest
needs: [build-runtimes, build-node]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -name "*.wasm" -exec cp {} release-assets/ \;
cp artifacts/polkadot-bulletin-chain-linux/polkadot-bulletin-chain release-assets/polkadot-bulletin-chain-linux
cp artifacts/polkadot-bulletin-chain-macos-aarch64/polkadot-bulletin-chain release-assets/polkadot-bulletin-chain-macos-aarch64
ls -la release-assets/
- name: Add runtime info to changelog
run: |
CONTEXT=$(find . -name '*_srtool_output.json')
SRTOOL() { <$(<<<$CONTEXT head -n1) jq -r .$1; }
WASM() { <${JSON} jq -r ".runtimes.compressed.subwasm.$1"; }
tee RELEASE_NOTES.md <<-EOF
# Runtime info
*These runtimes were built with **$(SRTOOL rustc)** using **[$(SRTOOL gen)](https://github.com/paritytech/srtool)***
EOF
for JSON in $(<<<$CONTEXT sort -sr)
do
RUNTIME_NAME=$(basename ${JSON} _srtool_output.json)
tee -a RELEASE_NOTES.md <<-EOF
## ${RUNTIME_NAME}
~~~
🏋️ Runtime Size: $(numfmt --to iec-i --format "%.2f" $(WASM size)) ($(WASM size) bytes)
🗜 Compressed: $(WASM 'compression | if .compressed then "Yes: \(1 - .size_compressed / .size_decompressed | . * 10000 | round / 100)%" else "No" end')
🔥 Core Version: $(WASM 'core_version | "\(.specName)-\(.specVersion) \(.implName)-\(.implVersion).tx\(.transactionVersion).au\(.authoringVersion)"')
🎁 Metadata version: V$(WASM metadata_version)
🗳️ Blake2-256 hash: $(WASM blake2_256)
📦 IPFS: $(WASM ipfs_hash)
~~~
EOF
done
cat RELEASE_NOTES.md
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
release-assets/*.wasm
release-assets/polkadot-bulletin-chain-linux
release-assets/polkadot-bulletin-chain-macos-aarch64
body_path: RELEASE_NOTES.md