Skip to content

Commit

Permalink
Try cross + docker
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Nov 29, 2023
1 parent d464122 commit 90f8795
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pipeline:
BUILD +test
BUILD +build
BUILD +e2e
BUILD +cross-build --TARGET=x86_64-unknown-linux-musl

install:
RUN apt-get update -qq
Expand All @@ -25,6 +26,8 @@ install:
# Tauri deps
RUN apt install -y libwebkit2gtk-4.0-dev
RUN update-ca-certificates
# Cross compilation
RUN cargo install cross
# Call +INIT before copying the source file to avoid installing depencies every time source code changes.
# This parametrization will be used in future calls to UDCs of the library
DO rust+INIT --keep_fingerprints=true
Expand All @@ -35,6 +38,15 @@ source:
COPY --keep-ts --dir server lib cli desktop ./
COPY browser+build/dist /code/browser/data-browser/dist

cross-build:
FROM +source
ARG --required TARGET
WITH DOCKER
DO rust+RUN_WITH_CACHE --command "cross build --target \$TARGET"
END
RUN wadoanw
SAVE ARTIFACT ./target/release/ target AS LOCAL artifact/target

build:
FROM +source
DO rust+CARGO --args="build --release" --output="release/[^/\.]+"
Expand Down

0 comments on commit 90f8795

Please sign in to comment.