Skip to content

Commit

Permalink
Revert "Build and upload runtime with paseo feature on release (#817)"
Browse files Browse the repository at this point in the history
This reverts commit 6262f6d.
  • Loading branch information
ccubu committed Oct 24, 2024
1 parent 95a32a1 commit 5d1ac39
Showing 1 changed file with 29 additions and 97 deletions.
126 changes: 29 additions & 97 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
outputs:
is_release_version: ${{ steps.check_version.outputs.is_release_version }}

srtool_build:
prepare-release:
needs: check-version
runs-on: ubuntu-latest
strategy:
Expand All @@ -54,121 +54,53 @@ jobs:
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
tag: 1.74.0
- name: Export output info
- name: Summary
id: summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > srtool-digest.json
- name: Upload Laos Wasm Artifact
uses: actions/upload-artifact@v3
with:
name: laos-wasm
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
srtool-digest.json
srtool_build_paseo:
needs: check-version
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
- { name: "laos", package: "laos-runtime", path: "runtime/laos" }
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: build_and_push
- name: Srtool build for paseo
id: srtool_build_paseo
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features paseo"
with:
chain: ${{ matrix.runtime.name }}
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
tag: 1.74.0
- name: Export output info
run: |
echo '${{ steps.srtool_build_paseo.outputs.json }}' | jq . > srtool-digest.json
- name: Upload Paseo Wasm Artifact
uses: actions/upload-artifact@v3
with:
name: paseo-wasm
path: |
${{ steps.srtool_build_paseo.outputs.wasm }}
${{ steps.srtool_build_paseo.outputs.wasm_compressed }}
srtool-digest.json
prepare-release:
needs: [srtool_build, srtool_build_paseo]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Laos Wasm Artifact
uses: actions/download-artifact@v3
with:
name: laos-wasm
path: laos-wasm
- name: Download Paseo Wasm Artifact
uses: actions/download-artifact@v3
with:
name: paseo-wasm
path: paseo-wasm
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 }}"
RUSTC_VERSION=$(jq '.info.rustc' < ${{ matrix.runtime.name }}-srtool-digest.json)
SRTOOL_VERSION=$(jq '.info.generator.version' < ${{ matrix.runtime.name }}-srtool-digest.json)
echo "rustc_version='$RUSTC_VERSION'" >> $GITHUB_OUTPUT
echo "srtool_version=$SRTOOL_VERSION" >> $GITHUB_OUTPUT
- 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: Extract metadata
id: metadata
run: |
LAOS_COMPRESSED_WASM="laos-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm"
LAOS_PASEO_COMPRESSED_WASM="paseo-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm"
subwasm --json info $LAOS_COMPRESSED_WASM > laos-info.json
subwasm info $LAOS_COMPRESSED_WASM > laos-info.txt
subwasm --json info $LAOS_PASEO_COMPRESSED_WASM > paseo-info.json
subwasm info $LAOS_PASEO_COMPRESSED_WASM > paseo-info.txt
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime.name }}-info.json
subwasm info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime.name }}-info.txt
cat ${{ matrix.runtime.name }}-info.txt
RUSTC_VERSION_POLKA=$(jq '.info.rustc' < laos-wasm/srtool-digest.json)
SRTOOL_VERSION_POLKA=$(jq '.info.generator.version' < laos-wasm/srtool-digest.json)
RUSTC_VERSION_PASEO=$(jq '.info.rustc' < paseo-wasm/srtool-digest.json)
SRTOOL_VERSION_PASEO=$(jq '.info.generator.version' < paseo-wasm/srtool-digest.json)
echo "rustc_version_polka='$RUSTC_VERSION_POLKA'" >> $GITHUB_OUTPUT
echo "srtool_version_polka=$SRTOOL_VERSION_POLKA" >> $GITHUB_OUTPUT
echo "rustc_version_paseo='$RUSTC_VERSION_PASEO'" >> $GITHUB_OUTPUT
echo "srtool_version_paseo=$SRTOOL_VERSION_PASEO" >> $GITHUB_OUTPUT
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.runtime.name }}-subwam-info.json
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.runtime.name }}-subwam-info.txt
cat ${{ matrix.runtime.name }}-subwam-info.txt
- name: Update Release Description with subwasm info
run: |
gh release view ${{ github.ref_name }} --json body -q .body > description.txt
RUSTC_VERSION=$(echo ${{ steps.summary.outputs.rustc_version }} | tr -d '"')
SRTOOL_VERSION=${{ steps.summary.outputs.srtool_version }}
RUSTC_VERSION_POLKA=$(echo ${{ steps.metadata.outputs.rustc_version_polka }} | tr -d '"')
SRTOOL_VERSION_POLKA=${{ steps.metadata.outputs.srtool_version_polka }}
RUSTC_VERSION_PASEO=$(echo ${{ steps.metadata.outputs.rustc_version_paseo }} | tr -d '"')
SRTOOL_VERSION_PASEO=${{ steps.metadata.outputs.srtool_version_paseo }}
printf "\n\n## Laos Runtime for Polkadot\nThis runtime was built using $RUSTC_VERSION_POLKA with srtool $SRTOOL_VERSION_POLKA\n" >> description.txt
echo '```' >> description.txt
cat laos-info.txt >> description.txt
echo '```' >> description.txt
printf "\n\n## Laos Runtime for Paseo\nThis runtime was built using $RUSTC_VERSION_PASEO with srtool $SRTOOL_VERSION_PASEO\n" >> description.txt
echo '```' >> description.txt
cat paseo-info.txt >> description.txt
printf "\n\n## ${{ matrix.runtime.name }} runtime\nThis runtime was built using %s with srtool %s\n" "$RUSTC_VERSION" "$SRTOOL_VERSION" >> description.txt
echo '```' >> description.txt
cat ${{ matrix.runtime.name }}-subwam-info.txt >> description.txt
echo '```' >> description.txt
gh release edit ${{ github.ref_name }} --notes-file description.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Files to Release
- name: Upload Ownership Wasm Binaries
run: |
gh release upload ${{ github.ref_name }} laos-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm
mv paseo-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm paseo-wasm/laos_paseo_runtime.compact.compressed.wasm
gh release upload ${{ github.ref_name }} paseo-wasm/laos_paseo_runtime.compact.compressed.wasm
echo "Uploading ownership wasm binary for tag ${{ github.ref_name }}"
gh release upload ${{ github.ref_name }} ${{ steps.srtool_build.outputs.wasm_compressed }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 5d1ac39

Please sign in to comment.