Skip to content

Fix stuck register shard tasks. #361

Fix stuck register shard tasks.

Fix stuck register shard tasks. #361

name: Update metadata
on:
pull_request:
paths:
- '.github/actions/cargo-command/**'
- '.github/workflows/pr-update-metadata.yaml'
- 'pallets/**'
- 'primitives/**'
- 'runtimes/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-runtime:
runs-on: [self-hosted, general]
strategy:
fail-fast: false
matrix:
include:
- package: mainnet-runtime
feature: default
crate: mainnet_runtime
- package: mainnet-runtime
feature: development
crate: mainnet_runtime
- package: testnet-runtime
feature: default
crate: testnet_runtime
- package: testnet-runtime
feature: development
crate: testnet_runtime
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build timechain runtime and metadata
uses: ./.github/actions/cargo-command
with:
package: ${{ matrix.package }}
feature: ${{ matrix.feature }}
- name: Upload timechain runtime
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.feature }}.wasm
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.compact.compressed.wasm
- name: Upload timechain metadata
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.feature }}.scale
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.metadata.scale
update-metadata:
runs-on: [self-hosted, general]
needs: [build-runtime]
if: ${{ always() }}
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Download Mainnet Metadata
id: download-mainnet-default
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: mainnet-runtime.default.scale
- name: Update Mainnet Metadata
if: steps.download-mainnet-default.outcome == 'success'
run: mv mainnet_runtime.metadata.scale config/subxt/mainnet.default.scale
- name: Download Staging Metadata
id: download-mainnet-development
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: mainnet-runtime.development.scale
- name: Update Staging Metadata
if: steps.download-mainnet-development.outcome == 'success'
run: mv mainnet_runtime.metadata.scale config/subxt/mainnet.development.scale
- name: Download Testnet Metadata
id: download-testnet-default
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: testnet-runtime.default.scale
- name: Update Testnet Metadata
if: steps.download-testnet-default.outcome == 'success'
run: mv testnet_runtime.metadata.scale config/subxt/testnet.default.scale
- name: Download Development Metadata
id: download-testnet-development
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: testnet-runtime.development.scale
- name: Update Development Metadata
if: steps.download-testnet-development.outcome == 'success'
run: mv testnet_runtime.metadata.scale config/subxt/testnet.development.scale
- name: Commit any changes to the metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! git diff --quiet; then
echo "metadata changes detected: committing updated metadata"
git config user.email "[email protected]"
git config user.name "Metadata Update Bot"
git commit -am "tc-subxt: Automatic metadata update"
git push
fi