Skip to content

Chain spec snapshot build #19

Chain spec snapshot build

Chain spec snapshot build #19

# This action enabling building chain spec used in the node build, can be triggered manually or by release creation.
#
# Regular and raw chain specs are built both for releases and for manually triggered runs, uploaded to artifacts and
# assets.
name: Chain spec snapshot build
on:
workflow_dispatch:
push:
tags:
- 'chain-spec-snapshot-*'
- 'chain-spec-mainnet-*'
jobs:
chains-spec:
runs-on: ubuntu-22.04
permissions:
contents: write
packages: write
steps:
- name: Build node image
id: build
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: docker/node.Dockerfile
pull: true
push: false
- name: Generate chain specifications
run: |
docker run --rm -u root ${{ steps.build.outputs.imageid }} build-spec --chain mainnet-compiled --disable-default-bootnode > chain-spec-mainnet.json
docker run --rm -u root ${{ steps.build.outputs.imageid }} build-spec --chain mainnet-compiled --disable-default-bootnode --raw > chain-spec-raw-mainnet.json
- name: Upload chain specifications to artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.1.3
with:
name: chain-specifications
path: |
chain-spec-mainnet.json
chain-spec-raw-mainnet.json
if-no-files-found: error
- name: Upload chain specifications to assets
uses: alexellis/upload-assets@13926a61cdb2cb35f5fdef1c06b8b591523236d3 # 0.4.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["chain-spec-mainnet.json", "chain-spec-raw-mainnet.json"]'
# Only run for releases
if: github.event_name == 'push' && github.ref_type == 'tag'