test #5
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-runtimes: | |
| runs-on: parity-large | |
| strategy: | |
| matrix: | |
| include: | |
| - name: bulletin-westend | |
| 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@v4 | |
| - 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@v4 | |
| with: | |
| name: ${{ matrix.name }}-runtime | |
| path: | | |
| ${{ steps.srtool_build.outputs.wasm_compressed }} | |
| ${{ matrix.name }}_srtool_output.json | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| needs: build-runtimes | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release assets | |
| run: | | |
| mkdir -p release-assets | |
| find artifacts -name "*.wasm" -exec cp {} release-assets/ \; | |
| 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 | |
| body_path: RELEASE_NOTES.md |