forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically build and attach production and dev runtimes to GH rele…
…ases (paritytech#2054) Closes https://github.com/paritytech/release-engineering/issues/6 Adds a new Github Workflow which on a new release being created, builds and attaches all runtimes managed in this repository in two flavours: - `dev-debug-build`: Built with the `try-runtime` feature and has logging enabled - `on-chain-release`: Built with the regular old `on-chain-release` feature The new Github Workflow could be extended in the future by the @paritytech/release-engineering team to fully automate the release process if they choose to, similar to how it is fully automated in the Fellowship repo (https://github.com/polkadot-fellows/runtimes/blob/main/.github/workflows/release.yml). The `on-chain-release` did not exist for parachains, so I added it. --- Tested on my fork: - https://github.com/liamaharon/polkadot-sdk/actions/runs/6663773523 - https://github.com/liamaharon/polkadot-sdk/releases/tag/test-6 --------- Co-authored-by: Chevdor <[email protected]> Co-authored-by: Dónal Murray <[email protected]>
- Loading branch information
1 parent
f46f5a9
commit a706171
Showing
8 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build and Attach Runtimes to Releases/RC | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
env: | ||
PROFILE: production | ||
|
||
jobs: | ||
build_and_upload: | ||
strategy: | ||
matrix: | ||
runtime: | ||
- { name: westend, package: westend-runtime, path: polkadot/runtime/westend } | ||
- { name: rococo, package: rococo-runtime, path: polkadot/runtime/rococo } | ||
- { name: asset-hub-rococo, package: asset-hub-rococo-runtime, path: cumulus/parachains/runtimes/assets/asset-hub-rococo } | ||
- { name: asset-hub-westend, package: asset-hub-westend-runtime, path: cumulus/parachains/runtimes/assets/asset-hub-westend } | ||
- { name: bridge-hub-rococo, package: bridge-hub-rococo-runtime, path: cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo } | ||
- { name: contracts-rococo, package: contracts-rococo-runtime, path: cumulus/parachains/runtimes/contracts/contracts-rococo } | ||
build_config: | ||
# Release build has logging disabled and no dev features | ||
- { type: on-chain-release, opts: --features on-chain-release-build } | ||
# Debug build has logging enabled and developer features | ||
- { type: dev-debug-build, opts: --features try-runtime } | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build ${{ matrix.runtime.name }} ${{ matrix.build_config.type }} | ||
id: srtool_build | ||
uses: chevdor/[email protected] | ||
env: | ||
BUILD_OPTS: ${{ matrix.build_config.opts }} | ||
with: | ||
chain: ${{ matrix.runtime.name }} | ||
package: ${{ matrix.runtime.package }} | ||
runtime_dir: ${{ matrix.runtime.path }} | ||
profile: ${{ env.PROFILE }} | ||
|
||
- name: Build Summary | ||
run: | | ||
echo "${{ steps.srtool_build.outputs.json }}" | jq . > ${{ matrix.runtime.name }}-srtool-digest.json | ||
cat ${{ matrix.runtime.name }}-srtool-digest.json | ||
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" | ||
- name: Set up paths and runtime names | ||
id: setup | ||
run: | | ||
RUNTIME_BLOB_NAME=$(echo ${{ matrix.runtime.package }} | sed 's/-/_/g').compact.compressed.wasm | ||
PREFIX=${{ matrix.build_config.type == 'dev-debug-build' && 'DEV_DEBUG_BUILD__' || '' }} | ||
echo "RUNTIME_BLOB_NAME=$RUNTIME_BLOB_NAME" >> $GITHUB_ENV | ||
echo "ASSET_PATH=./${{ matrix.runtime.path }}/target/srtool/${{ env.PROFILE }}/wbuild/${{ matrix.runtime.package }}/$RUNTIME_BLOB_NAME" >> $GITHUB_ENV | ||
echo "ASSET_NAME=$PREFIX$RUNTIME_BLOB_NAME" >> $GITHUB_ENV | ||
- name: Upload Runtime to Release | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.ASSET_PATH }} | ||
asset_name: ${{ env.ASSET_NAME }} | ||
asset_content_type: application/octet-stream | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
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
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
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
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