From 85f1ecabd7f58f306b2a042376209ac8cf49ab9b Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 18 Oct 2026 21:10:37 +0200 Subject: build: complete the Docker pipeline for build, test, screenshots and packaging - Container scripts now run from the mounted project (no image rebuild per script change): build-app.sh (strict -l 3, warnings fail), run-unit-tests.sh, screenshots.sh, app-diag.sh (perf/memory), lint.sh, package.sh and sim-vnc.sh (noVNC on 127.0.0.1:6080). - Headless simulator helpers: wait for port 1234, remove the stale single-instance lock (~/Sim-dev) that made later starts hang, show the simulator log on failure. - New targets: screenshots-approve, icons; `make lock` re-adds the requirements header; pytest treats warnings as errors. - Author/Summary headers on every build file. Co-Authored-By: Claude Opus 5.5 --- docker/scripts/package.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 docker/scripts/package.sh (limited to 'docker/scripts/package.sh') diff --git a/docker/scripts/package.sh b/docker/scripts/package.sh new file mode 100755 index 0000000..8d58e39 --- /dev/null +++ b/docker/scripts/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Author: cirakg & claude ai +# Summary: Build the signed .iq package for the Connect IQ Store beta, plus release .prg files for sideload tests. +# +# Usage: package.sh [DEVICE ...] (devices for the .prg files; default: TEST_DEVICES) +# Output: build/package/otp-wallet-.iq all 72 products, release, signed +# build/package/prg/.prg release builds for sideload tests +# +# The .iq is what you upload as a beta app (README section 4). It is built +# with the same strict settings as every other build: type check level 3 and +# no compiler warnings. +set -euo pipefail +# shellcheck source=ciq-env.sh +source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh" + +ciq_require_sdk +ciq_require_key + +version="$(sed -n 's/^ *const VERSION = "\([0-9.]*\)";.*/\1/p' /work/source/app/AppInfo.mc)" +[[ -n "${version}" ]] || die "could not read VERSION from source/app/AppInfo.mc" + +out="${BUILD_DIR}/package" +mkdir -p "${out}/prg" +iq="${out}/otp-wallet-${version}.iq" +compile_log="${out}/otp-wallet-${version}.log" + +log "exporting ${iq#/work/} for every product in manifest.xml (this takes a while)" +if ! monkeyc -e -r -f "/work/monkey.jungle;/work/icons.jungle" -o "${iq}" -y "${DEV_KEY}" -l 3 -w \ + >"${compile_log}" 2>&1; then + cat "${compile_log}" >&2 + die "packaging failed" +fi +if grep -q "^WARNING" "${compile_log}"; then + grep "^WARNING" "${compile_log}" >&2 + die "compiler warnings while packaging; warnings count as errors" +fi + +devices=("$@") +((${#devices[@]} > 0)) || read -r -a devices <<<"${TEST_DEVICES:-}" +for device in "${devices[@]}"; do + build-app.sh release "${device}" + cp "${BUILD_DIR}/release/${device}.prg" "${out}/prg/${device}.prg" +done + +log "package ready: ${iq#/work/} ($(du -h "${iq}" | cut -f1)); release .prg files in build/package/prg/" -- cgit v1.2.3