Files
marqdo-app-harness/scripts/tauri/build-image.sh
T
cflmy fafb49a633
ci/woodpecker/push/tauri-linux Pipeline is pending
ci/woodpecker/pr/ci Pipeline is pending
ci/woodpecker/pr/tauri-linux Pipeline is pending
ci/woodpecker/push/ci Pipeline was canceled
build(mqdh): pin the Tauri crate graph and build image recipe (#31)
- commit Cargo.lock for the desktop shell
- generate the desktop icon set from the existing approved MQDH icon
- add the app-owned Tauri build image Dockerfile/build script
- record the pinned Tauri CLI 2.13.0 and Rust 1.100 toolchain
2026-12-03 12:39:54 +08:00

31 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build (and optionally publish) the app-owned Tauri Linux build image.
#
# The image embeds the pinned Debian bookworm package set used to build the
# `.deb`; it is an app build environment, not a shared ecosystem image and not a
# product release. Immutable tag: `git.cflmy.cn/cflmy/mqdh-tauri-build:<version>`.
#
# scripts/tauri/build-image.sh # build only
# scripts/tauri/build-image.sh --push # build + push (needs MARQDO_GIT_TOKEN)
#
# Package inputs: `.build/tauri-image/{debs,lists}` (generated once from a
# bookworm container with `apt-get download`/`apt-get update`; see TAURI.md).
set -euo pipefail
cd "$(dirname "$0")/../.."
root="$PWD"
tag="${MQDH_TAURI_IMAGE_TAG:-0.2.0}"
registry="${MQDH_TAURI_IMAGE_REGISTRY:-git.cflmy.cn/cflmy}"
context="$root/.build/tauri-image"
test -d "$context/debs" || { echo "missing $context/debs" >&2; exit 1; }
test -d "$context/lists" || { echo "missing $context/lists" >&2; exit 1; }
cp scripts/tauri/Dockerfile "$context/Dockerfile"
export DOCKER_CONFIG="${DOCKER_CONFIG:-$root/.build/docker-config}"
docker build -t "mqdh-tauri-build:$tag" -f "$context/Dockerfile" "$context"
docker tag "mqdh-tauri-build:$tag" "$registry/mqdh-tauri-build:$tag"
if [ "${1:-}" = "--push" ]; then
: "${MARQDO_GIT_TOKEN:?set MARQDO_GIT_TOKEN to publish the image}"
echo "$MARQDO_GIT_TOKEN" | docker login "${registry%%/*}" -u "${MARQDO_GIT_USERNAME:-cflmy}" --password-stdin
docker push "$registry/mqdh-tauri-build:$tag"
echo "published $registry/mqdh-tauri-build:$tag"
fi