Add photobooth uploader build service
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-13 08:37:26 +01:00
parent 9f4a202d2b
commit 1ca7545f86
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail
WORKDIR=${WORKDIR:-/var/www/html}
SRC_DIR="${WORKDIR}/clients/photobooth-uploader/PhotoboothUploader"
OUT_DIR="${WORKDIR}/public/downloads"
OUT_FILE="${OUT_DIR}/PhotoboothUploader.exe"
STAMP_FILE="${OUT_DIR}/photobooth-uploader.hash"
if [[ ! -d "$SRC_DIR" ]]; then
echo "[photobooth-uploader] Source directory not found: ${SRC_DIR}"
exit 0
fi
mkdir -p "$OUT_DIR"
compute_hash() {
find "$SRC_DIR" -type f \
-not -path "*/bin/*" \
-not -path "*/obj/*" \
-print \
| LC_ALL=C sort \
| xargs sha256sum \
| sha256sum \
| awk '{print $1}'
}
HASH=$(compute_hash)
if [[ -f "$OUT_FILE" && -f "$STAMP_FILE" ]]; then
CURRENT_HASH=$(cat "$STAMP_FILE" || true)
if [[ "$CURRENT_HASH" == "$HASH" ]]; then
echo "[photobooth-uploader] Up to date, skipping publish."
exit 0
fi
fi
echo "[photobooth-uploader] Publishing uploader exe..."
dotnet publish "${SRC_DIR}/PhotoboothUploader.csproj" \
-c Release \
-r win-x64 \
--self-contained true \
/p:PublishSingleFile=true \
/p:IncludeNativeLibrariesForSelfExtract=true \
-o "$OUT_DIR"
echo "$HASH" > "$STAMP_FILE"
echo "[photobooth-uploader] Published to ${OUT_FILE}"