Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Aug 31, 2023
2 parents fcc049d + 2f27b9a commit 47bcbcb
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cumulus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ env:

on:
pull_request:
branches:
- master
types: [opened, reopened, synchronize]

push:
branches:
- "*"
tags:
- "v*"
branches:
- master

workflow_dispatch:
inputs:
Expand Down
66 changes: 64 additions & 2 deletions .github/workflows/moonbeam.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# placeholder to be able to trigger the new workflow
name: Manual Build - Moonbeam

env:
Expand Down Expand Up @@ -26,8 +25,71 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
path: action

- uses: actions/checkout@v3
with:
repository: PureStake/moonbeam
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
path: repo
ref: ${{ github.event.inputs.ref }}

# We now get extra information thanks to subwasm,
- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Srtool build
id: srtool_build
uses: ./action
with:
tag: ${{ github.event.inputs.srtool_tag }}
chain: ${{ matrix.chain }}
workdir: "${{ github.workspace }}/repo"

- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json
cat ${{ matrix.chain }}-srtool-digest.json
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
# it takes a while to build the runtime, so let's save the artifact as soon as we have it
- name: Archive Artifacts for ${{ matrix.chain }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.chain }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.chain }}-srtool-digest.json
- name: Show Runtime information
run: |
subwasm info ${{ steps.srtool_build.outputs.wasm }}
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }}
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-info_compressed.json
- name: Extract the metadata
run: |
subwasm meta ${{ steps.srtool_build.outputs.wasm }}
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json
- name: Check the metadata diff
run: |
# subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} | tee ${{ matrix.chain }}-diff.txt
echo "No live chain to compare" > ${{ matrix.chain }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: ${{ matrix.chain }}-runtime
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-info_compressed.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt
9 changes: 5 additions & 4 deletions .github/workflows/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ env:

on:
pull_request:
branches:
- master
types: [opened, reopened, synchronize]

push:
branches:
- "*"
tags:
- "v*"
branches:
- master

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:
tag: ${{ github.event.inputs.srtool_tag }}
chain: ${{ matrix.chain }}
workdir: "${{ github.workspace }}/repo"
profile: "production"

- name: Summary
run: |
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Make sure you store the yml files shown below in your repository under `.github/
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand All @@ -103,7 +103,7 @@ Make sure you store the yml files shown below in your repository under `.github/
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
- name: Summary
Expand All @@ -130,7 +130,7 @@ Make sure you store the yml files shown below in your repository under `.github/
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand Down Expand Up @@ -163,7 +163,7 @@ Make sure you store the yml files shown below in your repository under `.github/
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
env:
# optional: will be passed to docker srtool run cmd
BUILD_OPTS: "--features on-chain-release-build"
Expand Down Expand Up @@ -192,7 +192,7 @@ Make sure you store the yml files shown below in your repository under `.github/
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
env:
# optional: will override the parachain pallet ID and authorize_upgrade call ID,
# which will result in a different parachain_authorize_upgrade_hash
Expand All @@ -216,7 +216,7 @@ If unset, the two envs will have the following default values:

- `PARACHAIN_PALLET_ID`: `0x01`

- `AUTHORIZE_UPGRADE_PREFIX`: `0x03`
- `AUTHORIZE_UPGRADE_PREFIX`: `0x02`

## Contributing

Expand Down
17 changes: 14 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ inputs:
workdir:
description: >
Path of the project, this is where your main Cargo.toml is located. This is relative to $GITHUB_WORKSPACE.
required: true
default: "."
required: false

runtime_dir:
description: >
Location of the runtime in your repo. The default is 'runtime/<chain_name>'
required: false

profile:
description: >
Which profile to use with cargo build.
required: false
default: "release"

rustc_version:
description: >
Custom rustc version send to srtool container, if not set defualt use srtool images bundled version
Expand Down Expand Up @@ -127,10 +133,13 @@ runs:
echo "BUILD_OPTS=${{ env.BUILD_OPTS }}" >> $GITHUB_ENV
PROFILE=${{ inputs.profile }}
echo "PROFILE=$PROFILE" >> $GITHUB_ENV
PARACHAIN_PALLET_ID=${{ env.PARACHAIN_PALLET_ID }}
PARACHAIN_PALLET_ID=${PARACHAIN_PALLET_ID:-0x01}
AUTHORIZE_UPGRADE_PREFIX=${{ env.AUTHORIZE_UPGRADE_PREFIX }}
AUTHORIZE_UPGRADE_PREFIX=${AUTHORIZE_UPGRADE_PREFIX:-0x03}
AUTHORIZE_UPGRADE_PREFIX=${AUTHORIZE_UPGRADE_PREFIX:-0x02}
echo "PARACHAIN_PALLET_ID=$PARACHAIN_PALLET_ID" >> $GITHUB_ENV
echo "AUTHORIZE_UPGRADE_PREFIX=$AUTHORIZE_UPGRADE_PREFIX" >> $GITHUB_ENV
Expand All @@ -150,6 +159,7 @@ runs:
echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }}
echo ℹ️ build_opts: ${{ env.BUILD_OPTS }}
echo ℹ️ parachain_pallet_id: ${{ env.PARACHAIN_PALLET_ID }}
echo ℹ️ profile: ${{ env.PROFILE }}
echo ℹ️ authorize_upgrade_prefix: ${{ env.AUTHORIZE_UPGRADE_PREFIX }}
echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git`
echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml`
Expand Down Expand Up @@ -197,6 +207,7 @@ runs:
-e PARACHAIN_PALLET_ID
-e AUTHORIZE_UPGRADE_PREFIX
-e RUSTC_VERSION
-e PROFILE
-v ${{ env.WORKDIR }}:/build
${{ env.SRTOOL_IMAGE }} build --app --json -cM
"
Expand Down
2 changes: 1 addition & 1 deletion doc/parachain-overrides.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Similar to https://github.com/chevdor/subwasm[subwasm], the parachain pallet ID
If unset, the two envs will have the following default values:

- `PARACHAIN_PALLET_ID`: `0x01`
- `AUTHORIZE_UPGRADE_PREFIX`: `0x03`
- `AUTHORIZE_UPGRADE_PREFIX`: `0x02`
2 changes: 1 addition & 1 deletion examples/01_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand Down
2 changes: 1 addition & 1 deletion examples/02_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
- name: Summary
Expand Down
2 changes: 1 addition & 1 deletion examples/03_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand Down
2 changes: 1 addition & 1 deletion examples/05_build_opts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
env:
# optional: will be passed to docker srtool run cmd
BUILD_OPTS: "--features on-chain-release-build"
Expand Down
2 changes: 1 addition & 1 deletion examples/06_parachain_overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.8.0
env:
# optional: will override the parachain pallet ID and authorize_upgrade call ID,
# which will result in a different parachain_authorize_upgrade_hash
Expand Down

0 comments on commit 47bcbcb

Please sign in to comment.