Skip to content

Commit 0b0997e

Browse files
committed
fix(publish): enable frontend build for engine target and use turbo build instead of turbo build:engine
1 parent e0f2824 commit 0b0997e

9 files changed

Lines changed: 24 additions & 19 deletions

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
--secret id=DEPOT_TOKEN,env=DEPOT_TOKEN \
216216
--build-arg BUILD_TARGET=${{ matrix.build_target }} \
217217
--build-arg BUILD_MODE=${{ steps.mode.outputs.build_mode }} \
218-
--build-arg BUILD_FRONTEND=false \
218+
--build-arg BUILD_FRONTEND=${{ matrix.build_target == 'engine' && 'true' || 'false' }} \
219219
-f ${{ matrix.docker }} \
220220
-t builder-${{ matrix.build_target }}-${{ matrix.platform }} \
221221
--load \
@@ -262,7 +262,7 @@ jobs:
262262
echo "build_frontend=true" >> $GITHUB_OUTPUT
263263
else
264264
echo "cargo_build_mode=debug" >> $GITHUB_OUTPUT
265-
echo "build_frontend=false" >> $GITHUB_OUTPUT
265+
echo "build_frontend=true" >> $GITHUB_OUTPUT
266266
fi
267267
- uses: ./.github/actions/docker-setup
268268
with:

docker/build/darwin-arm64.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
3636
export SKIP_NAPI_BUILD=1 && \
3737
pnpm install --ignore-scripts && \
3838
if [ -n "$VITE_APP_API_URL" ]; then \
39-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
39+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
4040
else \
41-
npx turbo build:engine -F @rivetkit/engine-frontend; \
41+
npx turbo build -F @rivetkit/engine-frontend; \
4242
fi; \
4343
fi
4444

docker/build/darwin-x64.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
3636
export SKIP_NAPI_BUILD=1 && \
3737
pnpm install --ignore-scripts && \
3838
if [ -n "$VITE_APP_API_URL" ]; then \
39-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
39+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
4040
else \
41-
npx turbo build:engine -F @rivetkit/engine-frontend; \
41+
npx turbo build -F @rivetkit/engine-frontend; \
4242
fi; \
4343
fi
4444

docker/build/linux-arm64-gnu.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
2323
export SKIP_NAPI_BUILD=1 && \
2424
pnpm install --ignore-scripts && \
2525
if [ -n "$VITE_APP_API_URL" ]; then \
26-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
26+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
2727
else \
28-
npx turbo build:engine -F @rivetkit/engine-frontend; \
28+
npx turbo build -F @rivetkit/engine-frontend; \
2929
fi; \
3030
fi
3131

docker/build/linux-arm64-musl.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
2929
export SKIP_NAPI_BUILD=1 && \
3030
pnpm install --ignore-scripts && \
3131
if [ -n "$VITE_APP_API_URL" ]; then \
32-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
32+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
3333
else \
34-
npx turbo build:engine -F @rivetkit/engine-frontend; \
34+
npx turbo build -F @rivetkit/engine-frontend; \
3535
fi; \
3636
fi
3737

docker/build/linux-x64-gnu.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
3131
export SKIP_NAPI_BUILD=1 && \
3232
pnpm install --ignore-scripts && \
3333
if [ -n "$VITE_APP_API_URL" ]; then \
34-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
34+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
3535
else \
36-
npx turbo build:engine -F @rivetkit/engine-frontend; \
36+
npx turbo build -F @rivetkit/engine-frontend; \
3737
fi; \
3838
fi
3939

docker/build/linux-x64-musl.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
2828
export SKIP_NAPI_BUILD=1 && \
2929
pnpm install --ignore-scripts && \
3030
if [ -n "$VITE_APP_API_URL" ]; then \
31-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
31+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
3232
else \
33-
npx turbo build:engine -F @rivetkit/engine-frontend; \
33+
npx turbo build -F @rivetkit/engine-frontend; \
3434
fi; \
3535
fi
3636

docker/build/windows-x64.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
3636
export SKIP_NAPI_BUILD=1 && \
3737
pnpm install --ignore-scripts && \
3838
if [ -n "$VITE_APP_API_URL" ]; then \
39-
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
39+
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build -F @rivetkit/engine-frontend; \
4040
else \
41-
npx turbo build:engine -F @rivetkit/engine-frontend; \
41+
npx turbo build -F @rivetkit/engine-frontend; \
4242
fi; \
4343
fi
4444

docker/engine/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ FROM ghcr.io/rivet-dev/rivet/engine-base-builder:a36b881 AS builder
77
# Docker automatically provides TARGETARCH
88
ARG TARGETARCH
99

10+
ARG BUILD_FRONTEND=false
1011
ARG VITE_FEATURE_FLAGS=
1112
ARG CARGO_BUILD_MODE=debug
1213
ARG VITE_APP_API_URL=__SAME__
@@ -21,13 +22,17 @@ COPY . .
2122
# `lefthook install`, which needs a .git directory (excluded by
2223
# .dockerignore). lefthook is a dev-only git hook manager and has no
2324
# place inside the Docker build. SKIP_NAPI_BUILD=1 tells
24-
# @rivetkit/rivetkit-napi to skip its napi build — the frontend only
25+
# @rivetkit/rivetkit-napi to skip its napi build. The frontend only
2526
# consumes the TypeScript surface, not the runtime .node binary.
26-
RUN if [ -n "$VITE_FEATURE_FLAGS" ]; then \
27+
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
2728
export NODE_OPTIONS="--max-old-space-size=8192" && \
2829
export SKIP_NAPI_BUILD=1 && \
2930
pnpm install --ignore-scripts && \
30-
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" VITE_APP_TURNSTILE_SITE_KEY="${VITE_APP_TURNSTILE_SITE_KEY}" npx turbo build -F @rivetkit/engine-frontend; \
31+
if [ -n "$VITE_FEATURE_FLAGS" ]; then \
32+
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" VITE_APP_TURNSTILE_SITE_KEY="${VITE_APP_TURNSTILE_SITE_KEY}" npx turbo build -F @rivetkit/engine-frontend; \
33+
else \
34+
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_APP_TURNSTILE_SITE_KEY="${VITE_APP_TURNSTILE_SITE_KEY}" npx turbo build -F @rivetkit/engine-frontend; \
35+
fi; \
3136
fi
3237

3338
# Build and copy all binaries from target directory into an empty image (it is not

0 commit comments

Comments
 (0)