Build & Release / Run Tests (push) Has been cancelled
Traceability Validation / Check Requirement Traces (push) Has been cancelled
Build & Release / Build Linux (push) Has been cancelled
Build & Release / Build Android (push) Has been cancelled
Publish Documentation / Build & publish docs to gitea-pages (push) Has been cancelled
🏗️ Build and Test JellyTau / Android Compile Check (push) Has been cancelled
Build & Release / Create Release (push) Has been cancelled
🏗️ Build and Test JellyTau / Run Tests (push) Has been cancelled
Adds Docker-based packaging for Linux desktop (deb/rpm), Arch
(.pkg.tar.zst via makepkg), and Windows. Windows cross-compiles from
Linux via the official Tauri path — the x86_64-pc-windows-msvc target
driven by cargo-xwin — and produces an NSIS installer (nsis via
tauri.conf.json targets, since the CLI rejects --bundles nsis on a Linux
host). Verified end to end: builds jellytau.exe + jellytau_x64-setup.exe.
Unifies everything on one registry builder image (Dockerfile.builder):
Android SDK/NDK, rpm/file, clang(+clang-cl)/lld/llvm/nsis, cargo-xwin and
the msvc target. Packaging tools sit in a trailing layer so tool changes
rebuild in ~1min instead of ~15. Desktop stages are thin FROM
${BUILDER_IMAGE} layers; Arch uses a separate archlinux image.
CLAUDE.md: CI must install no system toolchains — everything lives in the
image. Bumps version 0.0.18 -> 0.1.0 (Windows support + webview audio +
equalizer).
TRACES: UR-003, UR-005 | DR-004
153 lines
5.4 KiB
Docker
153 lines
5.4 KiB
Docker
# Multi-stage build for JellyTau - Tauri Jellyfin client
|
|
#
|
|
# The desktop packaging stages (desktop-linux-build, windows-cross) build FROM
|
|
# the unified registry builder image, which carries every packaging tool. Declared
|
|
# here (before the first FROM) so it's in scope for those stages' FROM lines.
|
|
# Override for local iteration: --build-arg BUILDER_IMAGE=jellytau-builder:latest
|
|
ARG BUILDER_IMAGE=gitea.tourolle.paris/dtourolle/jellytau-builder:latest
|
|
|
|
FROM ubuntu:24.04 AS builder
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
ANDROID_HOME=/opt/android-sdk \
|
|
NDK_VERSION=27.0.11902837 \
|
|
SDK_VERSION=34 \
|
|
RUST_BACKTRACE=1 \
|
|
PATH="/root/.bun/bin:/root/.cargo/bin:$PATH" \
|
|
CARGO_HOME=/root/.cargo
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Build essentials
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
git \
|
|
ca-certificates \
|
|
unzip \
|
|
# JDK for Android
|
|
openjdk-17-jdk-headless \
|
|
# Android build tools
|
|
android-sdk-platform-tools \
|
|
# Additional development tools
|
|
pkg-config \
|
|
libssl-dev \
|
|
libclang-dev \
|
|
llvm-dev \
|
|
# Tauri Linux desktop dependencies (needed for `cargo test` on the host target)
|
|
libglib2.0-dev \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libjavascriptcoregtk-4.1-dev \
|
|
libsoup-3.0-dev \
|
|
librsvg2-dev \
|
|
libayatana-appindicator3-dev \
|
|
# mpv player library (linked via libmpv-sys)
|
|
libmpv-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Node.js 20.x from NodeSource
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
apt-get install -y --no-install-recommends nodejs && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Bun
|
|
RUN curl -fsSL https://bun.sh/install | bash && \
|
|
ln -s /root/.bun/bin/bun /usr/local/bin/bun
|
|
|
|
# Install Rust using rustup
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
|
|
. $HOME/.cargo/env && \
|
|
rustup target add aarch64-linux-android && \
|
|
rustup target add armv7-linux-androideabi && \
|
|
rustup target add x86_64-linux-android
|
|
|
|
# Setup Android SDK
|
|
RUN mkdir -p $ANDROID_HOME && \
|
|
mkdir -p /root/.android && \
|
|
echo '### User Sources for `android` cmd line tool ###' > /root/.android/repositories.cfg && \
|
|
echo 'count=0' >> /root/.android/repositories.cfg
|
|
|
|
# Download and setup Android Command Line Tools
|
|
RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdline-tools.zip && \
|
|
unzip -q /tmp/cmdline-tools.zip -d $ANDROID_HOME && \
|
|
rm /tmp/cmdline-tools.zip && \
|
|
mkdir -p $ANDROID_HOME/cmdline-tools/latest && \
|
|
mv $ANDROID_HOME/cmdline-tools/* $ANDROID_HOME/cmdline-tools/latest/ 2>/dev/null || true
|
|
|
|
# Setup Android SDK components
|
|
RUN $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME \
|
|
"platforms;android-$SDK_VERSION" \
|
|
"build-tools;34.0.0" \
|
|
"ndk;$NDK_VERSION" \
|
|
--channel=0 2>&1 | grep -v "Warning" || true
|
|
|
|
# Set NDK environment variable
|
|
ENV NDK_HOME=$ANDROID_HOME/ndk/$NDK_VERSION
|
|
|
|
# Create working directory
|
|
WORKDIR /app
|
|
|
|
# Copy project files
|
|
COPY . .
|
|
|
|
# Install Node.js dependencies
|
|
RUN bun install
|
|
|
|
# Install Rust dependencies
|
|
RUN cd src-tauri && cargo fetch && cd ..
|
|
|
|
# Build stage - Tests
|
|
FROM builder AS test
|
|
WORKDIR /app
|
|
RUN echo "Running tests..." && \
|
|
bunx svelte-kit sync && \
|
|
bun run test && \
|
|
cd src-tauri && cargo test && cd .. && \
|
|
echo "All tests passed!"
|
|
|
|
# Build stage - APK
|
|
FROM builder AS android-build
|
|
WORKDIR /app
|
|
RUN cd src-tauri && cargo fetch && cd .. && \
|
|
echo "Building Android APK..." && \
|
|
bun run build && \
|
|
bun run tauri android build --apk true && \
|
|
echo "APK build complete!"
|
|
|
|
# Desktop packaging stages build FROM the unified registry builder image (see the
|
|
# BUILDER_IMAGE ARG at the top), which already carries every packaging tool
|
|
# (rpm/file for Linux, mingw-w64 + nsis + the x86_64-pc-windows-gnu rust target
|
|
# for Windows). ONE source of dependency truth, shared with CI — no per-stage
|
|
# apt/rustup here.
|
|
|
|
# Linux desktop packaging environment (deb + rpm; Arch is Dockerfile.arch).
|
|
# Thin layer over the builder — the actual build runs at container-run time on
|
|
# the bind-mounted source (see docker-compose.yml / scripts/build-desktop-linux.sh),
|
|
# matching the `dev` service model. Run standalone with:
|
|
# docker run --rm -v "$PWD:/app" -v "$PWD/dist:/app/dist" <img> \
|
|
# bash -c "OUTPUT_DIR=/app/dist scripts/build-desktop-linux.sh"
|
|
FROM ${BUILDER_IMAGE} AS desktop-linux-build
|
|
WORKDIR /app
|
|
CMD ["bash", "-c", "OUTPUT_DIR=/app/dist scripts/build-desktop-linux.sh"]
|
|
|
|
# Windows cross-compile environment (MSVC target via cargo-xwin). Video works via
|
|
# WebView2 and audio via the webview <audio> backend; NSIS installer is produced
|
|
# from Linux by cargo-xwin. Default bundles NSIS; override WIN_BUNDLES=none for
|
|
# exe-only. Build runs at container-run time like above.
|
|
FROM ${BUILDER_IMAGE} AS windows-cross
|
|
WORKDIR /app
|
|
CMD ["bash", "-c", "OUTPUT_DIR=/app/dist WIN_BUNDLES=${WIN_BUNDLES:-nsis} scripts/build-windows-cross.sh"]
|
|
|
|
# Final output stage
|
|
FROM ubuntu:24.04 AS final
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
android-sdk-platform-tools \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY --from=android-build /app/src-tauri/gen/android/app/build/outputs/apk /app/apk
|
|
|
|
VOLUME ["/app/apk"]
|
|
CMD ["/bin/bash", "-c", "echo 'APK files are available in /app/apk' && ls -lh /app/apk/"]
|