diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1ec4c365..fcf9eb05 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,6 +40,7 @@ jobs: - name: Build & push docker images env: DOCKER_TAG: ${{ (github.ref_name == 'main' && 'unstable') || github.ref_name }} + LEAN_REPO_ROOT: ${{ github.workspace }} run: | make docker \ DOCKER_TAG=${{ env.DOCKER_TAG }} diff --git a/lean_client/Cross.toml b/lean_client/Cross.toml new file mode 100644 index 00000000..b5a973a5 --- /dev/null +++ b/lean_client/Cross.toml @@ -0,0 +1,2 @@ +[build.env] +volumes = ["LEAN_REPO_ROOT"] diff --git a/lean_client/Makefile b/lean_client/Makefile index e1d489b5..1d0b4237 100644 --- a/lean_client/Makefile +++ b/lean_client/Makefile @@ -17,6 +17,9 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') # Currently supported devnet. Used to publish devnet tag, along with `latest`. CURRENT_DEVNET := devnet-4 +# Repo root that cross bind-mounts into its build container (see +# `lean_client/Cross.toml`). Auto-derived locally; CI overrides via env. +LEAN_REPO_ROOT ?= $(shell git rev-parse --show-toplevel) # Temporary variable, which constructs `--tag` arguments, to be passed into # docker build command. It is used as intermediatery step, not as config @@ -70,13 +73,13 @@ clean: x86_64-unknown-linux-gnu: ./target/x86_64-unknown-linux-gnu/release/lean_client ./target/x86_64-unknown-linux-gnu/release/lean_client: - cross build --bin lean_client --target x86_64-unknown-linux-gnu --profile release + LEAN_REPO_ROOT=$(LEAN_REPO_ROOT) cross build --bin lean_client --target x86_64-unknown-linux-gnu --profile release .PHONY: aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu: ./target/aarch64-unknown-linux-gnu/release/lean_client ./target/aarch64-unknown-linux-gnu/release/lean_client: - cross build --bin lean_client --target aarch64-unknown-linux-gnu --profile release + LEAN_REPO_ROOT=$(LEAN_REPO_ROOT) cross build --bin lean_client --target aarch64-unknown-linux-gnu --profile release .PHONY: release release: docker