mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-17 19:25:41 +00:00
ci: use srtool-actions to build runtimes (#3423)
* ci: use chevdor/srtool-actions to build runtimes * cleanup
This commit is contained in:
+55
-54
@@ -24,38 +24,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime: ['polkadot', 'kusama']
|
runtime: ["polkadot", "kusama", "westend"]
|
||||||
container:
|
|
||||||
image: paritytech/srtool:nightly-2021-03-15
|
|
||||||
volumes:
|
|
||||||
- ${{ github.workspace }}:/build
|
|
||||||
env:
|
|
||||||
PACKAGE: ${{ matrix.runtime }}-runtime
|
|
||||||
RUSTC_VERSION: nightly-2020-10-27
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache target dir
|
- name: Cache target dir
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: '${{ github.workspace }}/runtime/${{ matrix.runtime }}/target'
|
path: "${{ github.workspace }}/runtime/${{ matrix.runtime }}/target"
|
||||||
key: srtool-target-${{ matrix.runtime }}-${{ github.sha }}
|
key: srtool-target-${{ matrix.runtime }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
srtool-target-${{ matrix.runtime }}-
|
srtool-target-${{ matrix.runtime }}-
|
||||||
srtool-target-
|
srtool-target-
|
||||||
- name: Build ${{ matrix.runtime }} runtime
|
- name: Build ${{ matrix.runtime }} runtime
|
||||||
id: build-runtime
|
id: srtool_build
|
||||||
shell: bash
|
uses: chevdor/srtool-actions@v0.3.0
|
||||||
env:
|
with:
|
||||||
srtool_output_filename: ${{ matrix.runtime }}_srtool_output.json
|
# This is the default with chevdor/srtool-actions@v0.3.0 but we make it clear
|
||||||
|
image: paritytech/srtool
|
||||||
|
chain: ${{ matrix.runtime }}
|
||||||
|
- name: Store srtool digest to disk
|
||||||
run: |
|
run: |
|
||||||
cd /build
|
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}_srtool_output.json
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
build --json | tee $srtool_output_filename
|
|
||||||
cat $srtool_output_filename
|
|
||||||
while IFS= read -r line; do
|
|
||||||
echo "::set-output name=$line::$(jq -r ".$line" < $srtool_output_filename)"
|
|
||||||
done <<< "$(jq -r 'keys[]' < $srtool_output_filename)"
|
|
||||||
- name: Upload ${{ matrix.runtime }} srtool json
|
- name: Upload ${{ matrix.runtime }} srtool json
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -65,49 +54,52 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.runtime }}-runtime
|
name: ${{ matrix.runtime }}-runtime
|
||||||
path: "${{ steps.build-runtime.outputs.wasm }}"
|
path: |
|
||||||
|
${{ steps.srtool_build.outputs.wasm }}
|
||||||
|
${{ steps.srtool_build.outputs.wasm_compressed }}
|
||||||
|
|
||||||
publish-draft-release:
|
publish-draft-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: ['get-rust-versions', 'build-runtimes']
|
needs: ["get-rust-versions", "build-runtimes"]
|
||||||
outputs:
|
outputs:
|
||||||
release_url: ${{ steps.create-release.outputs.html_url }}
|
release_url: ${{ steps.create-release.outputs.html_url }}
|
||||||
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
|
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: polkadot
|
path: polkadot
|
||||||
- name: Set up Ruby 2.7
|
- name: Set up Ruby 2.7
|
||||||
uses: actions/setup-ruby@v1
|
uses: actions/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.7
|
ruby-version: 2.7
|
||||||
- name: Download srtool json output
|
- name: Download srtool json output
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
- name: Generate release text
|
- name: Generate release text
|
||||||
env:
|
env:
|
||||||
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
|
RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }}
|
||||||
RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }}
|
RUSTC_NIGHTLY: ${{ needs.get-rust-versions.outputs.rustc-nightly }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gem install changelogerator git toml
|
gem install changelogerator git toml
|
||||||
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb | tee release_text.md
|
ruby $GITHUB_WORKSPACE/polkadot/scripts/github/generate_release_text.rb | tee release_text.md
|
||||||
- name: Create draft release
|
- name: Create draft release
|
||||||
id: create-release
|
id: create-release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{ github.ref }}
|
||||||
release_name: Polkadot ${{ github.ref }}
|
release_name: Polkadot ${{ github.ref }}
|
||||||
body_path: ./release_text.md
|
body_path: ./release_text.md
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
publish-runtimes:
|
publish-runtimes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: ['publish-draft-release']
|
needs: ["publish-draft-release"]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime: ['polkadot', 'kusama']
|
runtime: ["polkadot", "kusama", "westend"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
@@ -122,7 +114,7 @@ jobs:
|
|||||||
ls "${{ matrix.runtime }}-runtime"
|
ls "${{ matrix.runtime }}-runtime"
|
||||||
runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')"
|
runtime_ver="$(ruby -e 'require "./scripts/github/lib.rb"; puts get_runtime("${{ matrix.runtime }}")')"
|
||||||
echo "::set-output name=runtime_ver::$runtime_ver"
|
echo "::set-output name=runtime_ver::$runtime_ver"
|
||||||
- name: Upload ${{ matrix.runtime }} wasm
|
- name: Upload compact ${{ matrix.runtime }} wasm
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -131,6 +123,15 @@ jobs:
|
|||||||
asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.wasm"
|
asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.wasm"
|
||||||
asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.wasm
|
asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.wasm
|
||||||
asset_content_type: application/wasm
|
asset_content_type: application/wasm
|
||||||
|
- name: Upload compressed ${{ matrix.runtime }} wasm
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
|
||||||
|
asset_path: "${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm"
|
||||||
|
asset_name: ${{ matrix.runtime }}_runtime-v${{ steps.get-runtime-ver.outputs.runtime_ver }}.compact.compressed.wasm
|
||||||
|
asset_content_type: application/wasm
|
||||||
|
|
||||||
post_to_matrix:
|
post_to_matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Reference in New Issue
Block a user