Chronicle funds check #42
Workflow file for this run
This file contains 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: Update metadata | |
on: | |
pull_request: | |
paths: | |
- '.github/actions/cargo-command/**' | |
- '.github/workflows/pr-update-metadata.yaml' | |
- 'pallets/**' | |
- 'primitives/**' | |
- 'runtime/**' | |
- '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: timechain-runtime | |
feature: default | |
crate: timechain_runtime | |
- package: timechain-runtime | |
feature: development | |
crate: timechain_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 Testnet Metadata | |
id: download-testnet-default-metadata | |
uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
name: timechain-runtime.default.scale | |
- name: Update Testnet Metadata | |
if: steps.download-testnet-default-metadata.outcome == 'success' | |
run: mv timechain_runtime.metadata.scale config/subxt/testnet.default.scale | |
- name: Download Development Metadata | |
id: download-testnet-development-metadata | |
uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
name: timechain-runtime.development.scale | |
- name: Update Development Metadata | |
if: steps.download-testnet-development-metadata.outcome == 'success' | |
run: mv timechain_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 |