Skip to content

Create Runtimes releases #4

Create Runtimes releases

Create Runtimes releases #4

name: Create Runtimes releases
on:
workflow_dispatch:
inputs:
tag_version:
description: 'Tag version for the release'
required: true
type: string
jobs:
generate-chain-specs:
uses: ./.github/workflows/generate-chain-specs.yaml
permissions:
contents: write
with:
tag_version: ${{ github.event.inputs.tag_version }}
create-tag:
needs: generate-chain-specs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Setup Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.PASEO_RUNTIME_CI_PAT }}
- name: Create and push tag
run: |
git checkout ${{ github.ref }}
git tag ${{ github.event.inputs.tag_version }}
git push origin ${{ github.event.inputs.tag_version }}
srtool:
needs: create-tag
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
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"
- name: "people-paseo"
path: "system-parachains/people-paseo"
- name: "coretime-paseo"
path: "system-parachains/coretime-paseo"
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_version }}
- name: Cache runtime target dir
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/runtime/${{ matrix.runtime.name }}/target"
key: srtool-target-${{ matrix.runtime.name }}-${{ github.sha }}
restore-keys: |
srtool-target-${{ matrix.runtime.name }}-
srtool-target-
- 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.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.name }}-srtool-digest.json
# Copy artifacts
- name: Copy artifacts
run: cp `dirname ${{ steps.srtool_build.outputs.wasm }}`/*.wasm ./
- name: Archive Runtime
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runtime.name }}-runtime-${{ github.event.inputs.tag_version }}
path: |
${{ matrix.runtime.name }}*.wasm
${{ matrix.runtime.name }}-srtool-digest.json
# Release published: add artifacts to release
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag_version }}
name: Release ${{ github.event.inputs.tag_version }}
draft: false
prerelease: false
generate_release_notes: true
append_body: true
body: |
## 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 }}
🎁 Metadata version: V${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.metadata_version }}
🗳️ system.setCode hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.proposal_hash }}
🗳️ authorizeUpgrade hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.parachain_authorize_upgrade_hash }}
🗳️ Blake2-256 hash: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.blake2_256 }}
📦 IPFS: ${{ fromJSON(steps.srtool_build.outputs.json).runtimes.compressed.subwasm.ipfs_hash }}
```
files: |
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.runtime.name }}-srtool-digest.json
env:
GITHUB_TOKEN: ${{ secrets.PASEO_RUNTIME_CI_PAT }}