Skip to content

Commit

Permalink
Merged chevdor/srtool-actions 'v0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-semnet committed May 30, 2023
1 parent 4d58b15 commit ea89d00
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 110 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/bridges.yml

This file was deleted.

28 changes: 19 additions & 9 deletions .github/workflows/cumulus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ env:
DEFAULT_IMAGE: paritytech/srtool

on:
pull_request:
branches:
- master
push:
branches:
- "*"
Expand All @@ -18,7 +21,7 @@ on:
required: false
srtool_tag:
description: The SRTOOL tag to use
default: 1.57.0
default: 1.62.0
required: false

schedule:
Expand All @@ -30,16 +33,23 @@ jobs:
strategy:
fail-fast: false
matrix:
chain: ["statemine", "statemint", "westmint", "rococo-parachain", "shell"]

name: Build ${{ matrix.chain }}
include:
- category: contracts
runtime: contracts-rococo
- category: assets
runtime: statemine
- category: assets
runtime: statemint
- category: starters
runtime: shell
name: Build ${{ matrix.category }}/${{ matrix.runtime }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
path: action

- name: Checkout repo under test
uses: actions/checkout@v2
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
repository: paritytech/cumulus
fetch-depth: 0
Expand All @@ -51,12 +61,12 @@ jobs:
with:
image: ${{ github.event.inputs.srtool_image || env.DEFAULT_IMAGE }}
tag: ${{ github.event.inputs.srtool_tag }}
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}
chain: ${{ matrix.runtime }}
runtime_dir: parachains/runtimes/${{ matrix.category }}/${{ matrix.runtime }}
workdir: "${{ github.workspace }}/repo"

- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . | tee ${{ matrix.chain }}-srtool-digest.json
echo '${{ steps.srtool_build.outputs.json }}' | jq . | tee ${{ matrix.runtime }}-srtool-digest.json
echo "Compact Runtime location : ${{ steps.srtool_build.outputs.wasm }}"
echo "Compressed Runtime location : ${{ steps.srtool_build.outputs.wasm_compressed }}"
9 changes: 6 additions & 3 deletions .github/workflows/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ env:
DEFAULT_IMAGE: paritytech/srtool

on:
pull_request:
branches:
- master
push:
branches:
- "*"
Expand All @@ -18,7 +21,7 @@ on:
required: false
srtool_tag:
description: The SRTOOL tag to use
default: 1.57.0
default: 1.62.0
required: false

schedule:
Expand All @@ -34,12 +37,12 @@ jobs:

name: Build ${{ matrix.chain }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
path: action

- name: Checkout repo under test
uses: actions/checkout@v2
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
repository: paritytech/polkadot
fetch-depth: 0
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

== Contributing

WARNING: This project is using `asciidoc` for its documentation. You should **not** edit any mardown file (`.md`) as your changes would be dismissed.

Instead you should be editing the `.adoc` file and the markdown files will be generated. If you create a PR and do not have any of the required tooling, feel free to only edit the `.adoc.` files and I will generate the new `.md`.
97 changes: 87 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

<table>
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td style="text-align: left;"><p><img src="https://github.com/chevdor/srtool-actions/actions/workflows/bridges.yml/badge.svg?branch=master" alt="badge" /></p></td>
<td style="text-align: left;"><p><img src="https://github.com/chevdor/srtool-actions/actions/workflows/cumulus.yml/badge.svg?branch=master" alt="badge" /></p></td>
<td style="text-align: left;"><p><img src="https://github.com/chevdor/srtool-actions/actions/workflows/polkadot.yml/badge.svg?branch=master" alt="badge" /></p></td>
</tr>
Expand Down Expand Up @@ -70,10 +68,10 @@ Make sure you store the yml files shown below in your repository under `.github/
matrix:
chain: ["statemine", "westmint"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.1.0
uses: chevdor/srtool-actions@v0.6.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand All @@ -96,10 +94,10 @@ Make sure you store the yml files shown below in your repository under `.github/
matrix:
chain: ["westend"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.1.0
uses: chevdor/srtool-actions@v0.6.0
with:
chain: ${{ matrix.chain }}
- name: Summary
Expand All @@ -123,10 +121,10 @@ Make sure you store the yml files shown below in your repository under `.github/
matrix:
chain: ["statemine", "westmint"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.1.0
uses: chevdor/srtool-actions@v0.6.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
Expand All @@ -143,8 +141,87 @@ Make sure you store the yml files shown below in your repository under `.github/
${{ steps.srtool_build.outputs.wasm }}
${{ matrix.chain }}-srtool-digest.json

## Environmental variables and BUILD\_OPTS

name: Srtool build

on: push

jobs:
srtool:
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["statemine", "westmint"]
steps:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/[email protected]
env:
# optional: will be passed to docker srtool run cmd
BUILD_OPTS: "--features on-chain-release-build"
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
- 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 }}"

## Environmental variables and parachain overrides

name: Srtool build

on: push

jobs:
srtool:
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["statemine", "westmint"]
steps:
- uses: actions/checkout@v3
- name: Srtool build
id: srtool_build
uses: chevdor/[email protected]
env:
# optional: will override the parachain pallet ID and authorize_upgrade call ID,
# which will result in a different parachain_authorize_upgrade_hash
# the hex values must be quoted
PARACHAIN_PALLET_ID: "0x1e"
AUTHORIZE_UPGRADE_PREFIX: "0x02"
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
- 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 }}"

## Parachain overrides

Similar to [subwasm](https://github.com/chevdor/subwasm), the parachain pallet ID and the `authorize_upgrade` call ID can be overriden by `PARACHAIN_PALLET_ID` and `AUTHORIZE_UPGRADE_PREFIX` environmental variables, respectively. It will affect the generated proposal hash `parachain_authorize_upgrade_hash`.

If unset, the two envs will have the following default values:

- `PARACHAIN_PALLET_ID`: `0x01`

- `AUTHORIZE_UPGRADE_PREFIX`: `0x03`

## Contributing

This project is using `asciidoc` for its documentation. You should **not** edit any mardown file (`.md`) as your changes would be dismissed.

Instead you should be editing the `.adoc` file and the markdown files will be generated. If you create a PR and do not have any of the required tooling, feel free to only edit the `.adoc.` files and I will generate the new `.md`.

## Dev notes

### Tooling: `act`

Due to a [bug in act](https://github.com/nektos/act/issues/655), the defaults defined in the action are not applied. That means **must** pass all the inputs while testing with `act`.

You can test locally using [act](https://github.com/nektos/act):
Expand Down
5 changes: 3 additions & 2 deletions README_src.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
= SRTOOL Github Action
:toc: right

[cols="1,1,1"]
[cols="1,1"]
[frame=none]
[grid=none]
|===
a| image::https://github.com/chevdor/srtool-actions/actions/workflows/bridges.yml/badge.svg?branch=master[link="https://github.com/chevdor/srtool-actions/actions/workflows/bridges.yml"]
a| image::https://github.com/chevdor/srtool-actions/actions/workflows/cumulus.yml/badge.svg?branch=master[link="https://github.com/chevdor/srtool-actions/actions/workflows/cumulus.yml"]
a| image::https://github.com/chevdor/srtool-actions/actions/workflows/polkadot.yml/badge.svg?branch=master[link="https://github.com/chevdor/srtool-actions/actions/workflows/polkadot.yml"]
|===
Expand Down Expand Up @@ -45,5 +44,7 @@ If your project uses standard values (such as your runtime package being named `
== Sample workflows

include::examples/index.adoc[leveloffset=+1]
include::doc/parachain-overrides.adoc[leveloffset=+1]

include::CONTRIBUTING.adoc[]
include::doc/dev-notes.adoc[]
Loading

0 comments on commit ea89d00

Please sign in to comment.