From c413ec34e86308e1e30467b360235451b23fed89 Mon Sep 17 00:00:00 2001 From: kogeler <25884155+kogeler@users.noreply.github.com> Date: Wed, 22 May 2024 23:28:25 +0300 Subject: [PATCH] Fix runtime build --- .github/workflows/polkadot.yml | 8 +++++--- dockerfiles/Dockerfile.test | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/polkadot.yml b/.github/workflows/polkadot.yml index 25ed01c..25181e7 100644 --- a/.github/workflows/polkadot.yml +++ b/.github/workflows/polkadot.yml @@ -5,11 +5,13 @@ on: branches: paths: - .github/workflows/polkadot.yml + - dockerfiles/Dockerfile.test - dockerfiles/Dockerfile.amd64 - release-version.txt pull_request: paths: - .github/workflows/polkadot.yml + - dockerfiles/Dockerfile.test - dockerfiles/Dockerfile.amd64 - release-version.txt @@ -17,7 +19,6 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} RELEASE_REF: refs/heads/main - SKIP_WASM_BUILD: "1" jobs: build-docker-images: runs-on: ubuntu-latest @@ -114,6 +115,7 @@ jobs: echo "BINARY_FILE_NAME=${NODE_GIT_REF}-${ENV_VERSION}" >> $GITHUB_ENV echo "EXECUTE_WORKER_BINARY_FILE_NAME=${NODE_GIT_REF}-execute-worker-${ENV_VERSION}" >> $GITHUB_ENV echo "PREPARE_WORKER_BINARY_FILE_NAME=${NODE_GIT_REF}-prepare-worker-${ENV_VERSION}" >> $GITHUB_ENV + echo "WASM_BUILD_WORKSPACE_HINT=$(pwd)/polkadot-sdk" >> $GITHUB_ENV git config --global --add safe.directory $(pwd) - name: Checkout polkadot-sdk repository uses: actions/checkout@v4 @@ -122,9 +124,9 @@ jobs: path: polkadot-sdk ref: ${{ env.NODE_GIT_REF }} - name: Build binaries + working-directory: ./polkadot-sdk run: | - cd polkadot-sdk/polkadot - cargo build --release --target x86_64-unknown-linux-gnu + cargo build --profile production --locked --package polkadot --bin polkadot --target x86_64-unknown-linux-gnu ls /opt/cargo_target/x86_64-unknown-linux-gnu/release - name: "Create release" if: ${{ github.ref == env.RELEASE_REF }} diff --git a/dockerfiles/Dockerfile.test b/dockerfiles/Dockerfile.test index 7dd81f1..adce714 100644 --- a/dockerfiles/Dockerfile.test +++ b/dockerfiles/Dockerfile.test @@ -4,6 +4,8 @@ FROM ${IMAGE_VERSION} ARG GIT_REF -WORKDIR /home/rust -RUN git clone https://github.com/paritytech/polkadot-sdk.git polkadot-sdk && cd polkadot-sdk && git checkout ${GIT_REF} -RUN cd polkadot-sdk/polkadot && cargo build --release +ENV WASM_BUILD_WORKSPACE_HINT="/home/rust/polkadot-sdk" + +RUN git clone https://github.com/paritytech/polkadot-sdk.git polkadot-sdk --branch ${GIT_REF} --single-branch +WORKDIR /home/rust/polkadot-sdk +RUN cargo build --profile production --locked --package polkadot --bin polkadot