Switch all test and release build jobs from raw base images to the pre-baked images already defined in .docker/ and pushed to the local Gitea registry. Add actions/cache@v3 for Cargo registry and npm to eliminate redundant downloads on subsequent runs. Changes: - Dockerfile.linux-amd64/arm64: bake in rustfmt and clippy components - test.yml: rust jobs → trcaa-linux-amd64:rust1.88-node22; drop inline apt-get and rustup component-add steps; add cargo cache - test.yml: frontend jobs → add npm cache - auto-tag.yml: build-linux-amd64 → trcaa-linux-amd64; drop Install dependencies step and rustup target add - auto-tag.yml: build-windows-amd64 → trcaa-windows-cross; drop Install dependencies step and rustup target add - auto-tag.yml: build-linux-arm64 → trcaa-linux-arm64 (ubuntu:22.04-based); drop ~40-line Install dependencies step, . "$HOME/.cargo/env", and rustup target add (all pre-baked in image ENV PATH) - All build jobs: add cargo and npm cache steps - docs/wiki/CICD-Pipeline.md: document pre-baked images, cache keys, and insecure-registries daemon prerequisite Expected savings: ~70% faster PR test suite (~1.5 min vs ~5 min), ~72% faster release builds (~7 min vs ~25 min) after cache warms up. NOTE: Trigger build-images.yml via workflow_dispatch before merging to ensure images contain rustfmt/clippy before workflow changes land.
47 lines
2.3 KiB
Docker
47 lines
2.3 KiB
Docker
# Pre-baked cross-compiler for Linux arm64 Tauri releases (runs on Linux amd64).
|
|
# Bakes in: amd64 cross-toolchain, arm64 multiarch dev libs, Node.js, and Rust.
|
|
# This image takes ~15 min to build but is only rebuilt when deps change.
|
|
# Rebuild when: Rust toolchain version, webkit2gtk/gtk major version, or Node.js changes.
|
|
# Tag format: rust<VER>-node<VER>
|
|
FROM ubuntu:22.04
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Step 1: amd64 host tools and cross-compiler
|
|
RUN apt-get update -qq \
|
|
&& apt-get install -y -qq --no-install-recommends \
|
|
curl git gcc g++ make patchelf pkg-config perl jq \
|
|
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Step 2: Enable arm64 multiarch. Ubuntu uses ports.ubuntu.com for arm64 to avoid
|
|
# binary-all index conflicts with the amd64 archive.ubuntu.com mirror.
|
|
RUN dpkg --add-architecture arm64 \
|
|
&& sed -i 's|^deb http://archive.ubuntu.com|deb [arch=amd64] http://archive.ubuntu.com|g' /etc/apt/sources.list \
|
|
&& sed -i 's|^deb http://security.ubuntu.com|deb [arch=amd64] http://security.ubuntu.com|g' /etc/apt/sources.list \
|
|
&& printf '%s\n' \
|
|
'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse' \
|
|
'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse' \
|
|
'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse' \
|
|
> /etc/apt/sources.list.d/arm64-ports.list \
|
|
&& apt-get update -qq \
|
|
&& apt-get install -y -qq --no-install-recommends \
|
|
libwebkit2gtk-4.1-dev:arm64 \
|
|
libssl-dev:arm64 \
|
|
libgtk-3-dev:arm64 \
|
|
librsvg2-dev:arm64 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Step 3: Node.js 22
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
|
&& apt-get install -y --no-install-recommends nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Step 4: Rust 1.88 with arm64 cross-compilation target
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
|
--default-toolchain 1.88.0 --profile minimal --no-modify-path \
|
|
&& /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu \
|
|
&& /root/.cargo/bin/rustup component add rustfmt clippy
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|