Skip to content

Commit

Permalink
chaneg build optas and add a job to build runtimes with logging activ…
Browse files Browse the repository at this point in the history
…ated
  • Loading branch information
EgorPopelyaev committed Jul 8, 2024
1 parent defe4a4 commit 8b08e5f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Release - Publish draft

env:
LOGGING_NAME_SUFFIX: "logging"

on:
push:
tags:
Expand All @@ -26,7 +29,15 @@ jobs:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
build_opts: "--features metadata-hash"
build_opts: "--features on-chain-release-build"
name_suffix: ""

build-runtimes-with-logging:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
build_opts: ""
name_suffix: "-${{ github.env.LOGGING_NAME_SUFFIX }}"

build-binaries:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -146,6 +157,27 @@ jobs:
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm')
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
publish-runtimes-with-logging:
needs: [ build-runtimes-with-logging, publish-release-draft ]
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.build-runtimes-with-logging.outputs.published_runtimes) }}

steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Download artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4

- name: Get runtime info
env:
JSON: release-notes-context/${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }}/${{ matrix.chain }}-srtool-digest.json
run: |
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime-${{ env.LOGGING_NAME_SUFFIX }} -name '*.compact.compressed.wasm')
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
- name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm
if: ${{ matrix.chain != 'rococo-parachain' }}
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2
Expand All @@ -154,7 +186,7 @@ jobs:
with:
upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm
asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}-${{ env.LOGGING_NAME_SUFFIX }}.compact.compressed.wasm
asset_content_type: application/wasm

publish-binaries:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/release-srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
type: string
build_opts:
type: string
name_suffix:
type: string
outputs:
published_runtimes:
value: ${{ jobs.find-runtimes.outputs.runtime }}
Expand Down Expand Up @@ -78,20 +80,20 @@ jobs:
with:
fetch-depth: 0

- name: Prepare build options
run: |
BUILD_OPTIONS=""
if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then
BUILD_OPTIONS="${{ inputs.build_opts }}"
fi
# - name: Prepare build options
# run: |
# BUILD_OPTIONS=""
# if [[ ${{ matrix.chain }} == 'asset-hub-rococo' || ${{ matrix.chain }} == 'asset-hub-westend' || ${{ matrix.chain }} == 'rococo' || ${{ matrix.chain }} == 'westend' ]]; then
# BUILD_OPTIONS="${{ inputs.build_opts }}"
# fi

echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV
# echo "BUILD_OPTIONS=${BUILD_OPTIONS}" >> $GITHUB_ENV

- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.9.2
env:
BUILD_OPTS: ${{ env.BUILD_OPTIONS }}
BUILD_OPTS: ${{ inputs.build_opts }}
with:
chain: ${{ matrix.chain }}
runtime_dir: ${{ matrix.runtime_dir }}
Expand Down Expand Up @@ -135,7 +137,7 @@ jobs:
- name: Archive Subwasm results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: ${{ matrix.chain }}-runtime
name: ${{ matrix.chain }}-runtime${{ inputs.name_suffix }}
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-compressed-info.json
Expand Down

0 comments on commit 8b08e5f

Please sign in to comment.