From 8af256e15817554dac4a1f4f678007972d1471ef Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:07:39 +0530 Subject: [PATCH] Generate runtime wasm on master and release (#606) * release v0.6.7 * srtool actions * srtool actions * try empty string * try if else * try if else * fix wasm build * cleanup --- .github/workflows/generate-srtool-wasm.yml | 48 +++++++++++++++++++ .github/workflows/publish-srtool-wasm.yml | 48 +++++++++++++++++++ .../src/misbehavior/dfns_cggmp21/integer.rs | 1 + runtime/mainnet/Cargo.toml | 1 + 4 files changed, 98 insertions(+) create mode 100644 .github/workflows/generate-srtool-wasm.yml create mode 100644 .github/workflows/publish-srtool-wasm.yml diff --git a/.github/workflows/generate-srtool-wasm.yml b/.github/workflows/generate-srtool-wasm.yml new file mode 100644 index 000000000..6ccca997e --- /dev/null +++ b/.github/workflows/generate-srtool-wasm.yml @@ -0,0 +1,48 @@ +name: Srtool build Wasm + +on: + workflow_dispatch: + + push: + branches: [main] + +jobs: + srtool: + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["testnet", "mainnet"] + steps: + + - uses: actions/checkout@v3 + + - name: Srtool build + if: matrix.chain == 'mainnet' + id: srtool_build + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-runtime + + - name: Srtool build testnet + if: matrix.chain == 'testnet' + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-testnet-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 }}" + + - name: Archive Runtime + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.chain }}-runtime-${{ github.sha }} + path: | + ${{ steps.srtool_build.outputs.wasm }} + ${{ matrix.chain }}-srtool-digest.json \ No newline at end of file diff --git a/.github/workflows/publish-srtool-wasm.yml b/.github/workflows/publish-srtool-wasm.yml new file mode 100644 index 000000000..4f27ec4cc --- /dev/null +++ b/.github/workflows/publish-srtool-wasm.yml @@ -0,0 +1,48 @@ +name: Srtool Wasm Publish + +on: + workflow_dispatch: + + push: + tags: ["v*.*.*"] + +jobs: + srtool: + runs-on: ubuntu-latest + strategy: + matrix: + chain: ["testnet", "mainnet"] + steps: + - uses: actions/checkout@v3 + + - name: Srtool build + if: matrix.chain == 'mainnet' + id: srtool_build + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-runtime + + - name: Srtool build testnet + if: matrix.chain == 'testnet' + uses: chevdor/srtool-actions@v0.8.0 + with: + chain: ${{ matrix.chain }} + runtime_dir: runtime/${{ matrix.chain }} + package: tangle-testnet-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 }}" + + - name: Upload ${{ matrix.chain }} wasm to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ steps.srtool_build.outputs.wasm }} + asset_name: tangle-${{ matrix.features }}-srtool-wasm + tag: ${{ github.ref }} + overwrite: true \ No newline at end of file diff --git a/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs b/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs index 3f5dd7894..b1fd2cd65 100644 --- a/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs +++ b/pallets/dkg/src/misbehavior/dfns_cggmp21/integer.rs @@ -15,6 +15,7 @@ // along with Tangle. If not, see . use malachite_base::num::conversion::traits::FromStringBase; +use parity_scale_codec::alloc::vec; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; diff --git a/runtime/mainnet/Cargo.toml b/runtime/mainnet/Cargo.toml index 34733e595..5cced3c1e 100644 --- a/runtime/mainnet/Cargo.toml +++ b/runtime/mainnet/Cargo.toml @@ -215,6 +215,7 @@ std = [ "pallet-roles/std", "sp-storage/std", "pallet-jobs/std", + "pallet-jobs-rpc-runtime-api/std", # Tangle dependencies "tangle-primitives/std",