Skip to content

Commit

Permalink
Merge pull request #129 from paseo-network/release/1.3.1-runtime
Browse files Browse the repository at this point in the history
Update runtime v1.3.1
  • Loading branch information
hbulgarini authored Oct 11, 2024
2 parents 946eb86 + eca9d5e commit 592cafb
Show file tree
Hide file tree
Showing 264 changed files with 28,022 additions and 10,878 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
name: Build Deterministic Runtimes
name: Create Runtimes releases

on:
release:
types: [published]
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
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
Expand All @@ -21,9 +53,14 @@ jobs:
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
Expand All @@ -49,24 +86,27 @@ jobs:
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.runtime.name }}-srtool-digest.json
# Manual trigger: add artifacts to run
# Copy artifacts
- name: Copy artifacts
if: github.event_name != 'release'
run: cp `dirname ${{ steps.srtool_build.outputs.wasm }}`/*.wasm ./

- name: Archive Runtime
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runtime.name }}-runtime-${{ github.sha }}
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: Add artifacts to release
if: github.event_name == '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 }}`
Expand All @@ -82,3 +122,5 @@ jobs:
files: |
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.runtime.name }}-srtool-digest.json
env:
GITHUB_TOKEN: ${{ secrets.PASEO_RUNTIME_CI_PAT }}
85 changes: 85 additions & 0 deletions .github/workflows/generate-chain-specs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Generate Chain Specs

on:
workflow_dispatch:
inputs:
tag_version:
description: 'Tag version for the release'
required: true
type: string
workflow_call:
inputs:
tag_version:
description: 'Tag version for the release'
required: true
type: string

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
generate-chain-specs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y git protobuf-compiler
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.77.0
target: wasm32-unknown-unknown
components: rust-src
override: true

- name: Add rust-src
run: rustup component add rust-src --toolchain 1.77.0-x86_64-unknown-linux-gnu

- name: Build chain-spec-generator
run: cargo build --package chain-spec-generator --features=fast-runtime --release

- name: Generate chain specs
run: |
mkdir -p chain-specs/local
PACKAGES=(
"paseo-local"
"paseo-dev"
"asset-hub-paseo-local"
"bridge-hub-paseo-local"
"people-paseo-local"
"coretime-paseo-local"
)
for pkg in "${PACKAGES[@]}"; do
./target/release/chain-spec-generator "$pkg" --raw > "chain-specs/local/$pkg.json"
echo "Generated chain-specs/local/$pkg.json"
done
- 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: Commit changes
run: |
git add chain-specs/local/*.json
if git diff --staged --quiet; then
echo "No changes detected in chain specs. Skipping commit."
else
COMMIT_MESSAGE="Update chain specs for version ${{ inputs.tag_version }}"
git commit -m "$COMMIT_MESSAGE"
git push
echo "Changes committed and pushed successfully."
fi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rls*.log
runtime/wasm/target/
substrate.code-workspace
target/
**/tmp_runtime
**/.tmp_runtime
**/tmp_hub
*.log
*.patch
Loading

0 comments on commit 592cafb

Please sign in to comment.