fix(release): build macOS updater bundles (#1733)
This commit is contained in:
@@ -172,6 +172,25 @@ printf 'unsigned macOS artifact\n' > "$macos_artifact"
|
||||
"$macos_assets_dir" macos-arm64 >/dev/null
|
||||
pass "verify-desktop-assets accepts macOS artifacts without optional updater bundles"
|
||||
|
||||
if "$ROOT_DIR/scripts/release/verify-desktop-assets.sh" --require-updaters \
|
||||
"$macos_assets_dir" macos-arm64 >"$OUT_FILE" 2>"$ERR_FILE"; then
|
||||
fail "verify-desktop-assets should require a key-enabled macOS updater bundle"
|
||||
fi
|
||||
grep -q "Missing updater artifact for platform: macos-arm64" "$ERR_FILE" || \
|
||||
fail "verify-desktop-assets did not explain the missing macOS updater bundle"
|
||||
pass "verify-desktop-assets requires key-enabled updater bundles"
|
||||
|
||||
macos_updater="$macos_assets_dir/kandev-desktop-macos-arm64-Kandev.app.tar.gz"
|
||||
printf 'signed macOS updater\n' > "$macos_updater"
|
||||
printf 'signature\n' > "$macos_updater.sig"
|
||||
"$ROOT_DIR/scripts/release/write-sha256.sh" \
|
||||
"$macos_updater" "$macos_updater.sha256"
|
||||
"$ROOT_DIR/scripts/release/write-sha256.sh" \
|
||||
"$macos_updater.sig" "$macos_updater.sig.sha256"
|
||||
"$ROOT_DIR/scripts/release/verify-desktop-assets.sh" --require-updaters \
|
||||
"$macos_assets_dir" macos-arm64 >/dev/null
|
||||
pass "verify-desktop-assets accepts signed required updater bundles"
|
||||
|
||||
missing_assets_dir="$TMP_DIR/missing-assets"
|
||||
mkdir -p "$missing_assets_dir"
|
||||
if "$ROOT_DIR/scripts/release/verify-desktop-assets.sh" \
|
||||
|
||||
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: verify-desktop-assets.sh <assets-dir> [platform...]
|
||||
Usage: verify-desktop-assets.sh [--require-updaters] <assets-dir> [platform...]
|
||||
|
||||
Checks that each required platform has at least one desktop artifact named:
|
||||
|
||||
@@ -14,6 +14,8 @@ and that every matching artifact has a sibling .sha256 file. If no platform is
|
||||
given, all supported desktop platforms are required. Signed Tauri updater
|
||||
artifacts (`*.app.tar.gz`, `*.AppImage.tar.gz`, and `*.nsis.zip`) must have a
|
||||
matching `*.sig` file, and signatures without their updater bundle are rejected.
|
||||
When --require-updaters is set, every requested platform must also include its
|
||||
signed updater bundle.
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -22,7 +24,13 @@ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ASSETS_DIR="${1:?Usage: verify-desktop-assets.sh <assets-dir> [platform...]}"
|
||||
REQUIRE_UPDATERS=false
|
||||
if [ "${1:-}" = "--require-updaters" ]; then
|
||||
REQUIRE_UPDATERS=true
|
||||
shift
|
||||
fi
|
||||
|
||||
ASSETS_DIR="${1:?Usage: verify-desktop-assets.sh [--require-updaters] <assets-dir> [platform...]}"
|
||||
shift || true
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
@@ -86,7 +94,9 @@ for platform in "${REQUIRED_PLATFORMS[@]}"; do
|
||||
fi
|
||||
|
||||
updater_suffix="$(updater_suffix_for_platform "$platform")"
|
||||
updater_found=0
|
||||
for updater_bundle in "$ASSETS_DIR"/kandev-desktop-"$platform"-$updater_suffix; do
|
||||
updater_found=$((updater_found + 1))
|
||||
if [ ! -f "$updater_bundle.sig" ]; then
|
||||
echo "Missing updater signature: $updater_bundle.sig" >&2
|
||||
exit 1
|
||||
@@ -99,6 +109,10 @@ for platform in "${REQUIRED_PLATFORMS[@]}"; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
if [ "$REQUIRE_UPDATERS" = true ] && [ "$updater_found" -eq 0 ]; then
|
||||
echo "Missing updater artifact for platform: $platform" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Desktop release assets verified in $ASSETS_DIR"
|
||||
|
||||
Reference in New Issue
Block a user