Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's build-subwasm job become a common action #867

Closed
fewensa opened this issue Apr 25, 2022 · 0 comments
Closed

Let's build-subwasm job become a common action #867

fewensa opened this issue Apr 25, 2022 · 0 comments
Assignees

Comments

@fewensa
Copy link
Contributor

fewensa commented Apr 25, 2022

this is used by Darwinia and Darwinia Parachain projects

##
# Generate subwasm info
##
build-subwasm:
name: Generate subwasm info
runs-on: ubuntu-latest
container:
image: ubuntu:16.04
strategy:
matrix:
runtime: [crab, darwinia]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
apt update -y
apt install --no-install-recommends -y \
git curl ca-certificates \
make gcc g++ clang-4.0
- name: Install subwasm
env:
# Currently, Same with srtool version v0.9.18
# https://github.com/paritytech/srtool/blob/v0.9.18/Dockerfile#L19
SUBWASM_VERSION: 0.15.0
run: |
curl -L https://github.com/chevdor/subwasm/releases/download/v${SUBWASM_VERSION}/subwasm_linux_amd64_v${SUBWASM_VERSION}.deb \
--output subwasm.deb && \
dpkg -i subwasm.deb && \
subwasm --version
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
- name: Cache target
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build darwinia
run: |
set -xe
RUNTIME_DIR=runtime/${{ matrix.runtime }}
cargo build \
--manifest-path runtime/${{ matrix.runtime }}/Cargo.toml \
--features on-chain-release-build \
--release \
--target x86_64-unknown-linux-gnu
- name: Collect shared
run: |
mkdir -p shared/${{ matrix.runtime }}-runtime
mv target/x86_64-unknown-linux-gnu/release/wbuild/${{ matrix.runtime }}-runtime/*.wasm \
shared/${{ matrix.runtime }}-runtime
- name: Generate subwasm info for ${{ matrix.runtime }}-runtime
run: |
set -xe
Z_WASM=shared/${{ matrix.runtime }}-runtime/*.compact.compressed.wasm
echo '${{ matrix.runtime }}-runtime compressed compact subwasm info'
subwasm -j info $Z_WASM | tee shared/${{ matrix.runtime }}-runtime/${{ matrix.runtime }}-runtime.compact.compressed.json
- name: Upload shared
uses: actions/upload-artifact@v2.2.4
with:
name: darwinia-artifact
path: shared
- name: Optimize cache
run: .github/optimize-cache.sh || exit 0
- uses: vishnudxb/cancel-workflow@v1.2
if: failure()
with:
repo: darwinia-network/bridger
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}

@fewensa fewensa self-assigned this Apr 25, 2022
@hackfisher hackfisher added the P-Mid [Priority] Median label May 16, 2022
@AurevoirXavier AurevoirXavier removed the P-Mid [Priority] Median label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants