Two builder images, because the jobs genuinely need two distributions: Ubuntu for the tests, the Linux bundle and the Android APK, and Arch for the .pkg.tar.zst, since makepkg is Arch-specific. Both are built from this repo (NFR-12) and pinned by tag in the workflows, so a Dockerfile change only reaches CI once it has been pushed. libdbus-1-dev is not incidental in the Ubuntu image: btleplug's Linux backend is bluez-async over the dbus crate, so without it the workspace does not build at all. The per-commit Android job is a cargo check, not an APK. The full signed build is ~15 minutes and runs only on tags; a one-minute check catches what actually breaks — the JNI shim, droidplug, and any desktop-only API that has crept into a shared crate. Two invariants a compiler cannot see are checked there too, because both fail silently: the app builds, installs, launches, and finds no trainer. The JNI symbol in android.rs is matched by the runtime by name, so renaming the Kotlin package compiles fine and simply never initialises btleplug; and gen/ must stay untracked or the sync script quietly becomes optional. The Android versionCode carries a 1000 floor. `tauri android init` writes 1000 for 0.1.0 today, so anyone holding a locally built APK already has that number installed, and a bare major/minor/patch code would be 100 — a downgrade, which Android refuses outright. The fmt check is advisory for now. The tree predates this workflow and `cargo fmt --all` currently rewrites ~2000 lines across 28 files; making it a gate here would mean landing a repo-wide reformat as a side effect of adding CI. Run fmt in its own commit, then drop the continue-on-error. The two clippy warnings that stood between the tree and a real `-D warnings` gate are fixed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.7 KiB
Docker
39 lines
1.7 KiB
Docker
# BikeControl Arch Linux package builder.
|
|
#
|
|
# Separate from Dockerfile.builder on purpose: makepkg is Arch-specific, so the
|
|
# .pkg.tar.zst cannot be produced from the Ubuntu image that builds everything
|
|
# else. This is an *environment* image — it carries no source, so the same tag
|
|
# serves both CI (which checks the repo out at run time) and local use.
|
|
#
|
|
# Build and push:
|
|
# docker build -f Dockerfile.arch -t gitea.tourolle.paris/dtourolle/bikecontrol-arch-builder:latest .
|
|
# docker push gitea.tourolle.paris/dtourolle/bikecontrol-arch-builder:latest
|
|
#
|
|
# Local one-shot build of the package:
|
|
# docker run --rm -v "$PWD:/app" -v "$PWD/dist:/out" \
|
|
# gitea.tourolle.paris/dtourolle/bikecontrol-arch-builder:latest
|
|
FROM archlinux:latest
|
|
|
|
# base-devel brings makepkg, fakeroot and the rest of the packaging toolchain.
|
|
# The remainder are the PKGBUILD's makedepends plus what Tauri and btleplug link
|
|
# against: webkit2gtk-4.1/gtk3 for the shell, and dbus for BlueZ.
|
|
RUN pacman -Syu --noconfirm \
|
|
base-devel git sudo \
|
|
rust nodejs npm \
|
|
webkit2gtk-4.1 gtk3 libayatana-appindicator \
|
|
libsoup3 pkgconf openssl dbus bluez-libs \
|
|
&& pacman -Scc --noconfirm
|
|
|
|
# makepkg refuses to run as root. The passwordless sudo is for `makepkg -s`,
|
|
# which pacman-installs missing makedepends.
|
|
RUN useradd -m builder && \
|
|
echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
|
|
|
|
WORKDIR /app
|
|
RUN mkdir -p /out && chown builder:builder /out
|
|
VOLUME ["/out"]
|
|
|
|
# CI overrides this and runs the script itself (it must chown the checkout to
|
|
# `builder` first). The default is the local convenience path.
|
|
CMD ["bash", "-c", "chown -R builder:builder /app && sudo -u builder --preserve-env=OUTPUT_DIR OUTPUT_DIR=/out scripts/build-arch.sh --no-install"]
|