You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
# Lädt DMG und Appcast auf den Update-Server. Ab dann bieten alle installierten
# Mawari-Kopien das Update beim nächsten Start (bzw. binnen eines Tages) an.
#
# Einmalig vorher den Ordner auf dem Server anlegen (siehe zielke-apps/README.md):
# ssh -t samuelzielke@10.0.5.223 'sudo install -d -o samuelzielke -g www-data -m 2775 /var/www/updates/mawari'
#
# Aufruf: bash Tools/publish.sh
set -euo pipefail
cd "$(dirname "$0")/.."
SERVER="${SERVER:-samuelzielke@10.0.5.223}"
DEST="/var/www/updates/mawari/"
VERSION=$(grep -m1 'MARKETING_VERSION:' project.yml | sed -E 's/.*MARKETING_VERSION: *"?([^"]+)"?/\1/')
DMG="build/Mawari-${VERSION}.dmg"
[ -f "$DMG" ] && [ -f build/appcast.xml ] || { echo "Fehler: erst Tools/build-dmg.sh und Tools/make-appcast.sh." >&2; exit 1; }
grep -q "Mawari-${VERSION}.dmg" build/appcast.xml || { echo "Fehler: appcast.xml passt nicht zu $VERSION." >&2; exit 1; }
cp "$DMG" build/Mawari-latest.dmg
# DMG zuerst, Appcast zuletzt – sonst zeigt der Appcast kurz auf eine fehlende Datei.
rsync -a --chmod=F644 "$DMG" build/Mawari-latest.dmg "$SERVER:$DEST"
rsync -a --chmod=F644 build/appcast.xml "$SERVER:$DEST"
echo "==> Veröffentlicht: https://update.zielke.studio/mawari/appcast.xml (Version $VERSION)"
curl -fsS "https://update.zielke.studio/mawari/appcast.xml" | grep -o "<sparkle:shortVersionString>[^<]*" || echo "Hinweis: Appcast noch nicht abrufbar (Proxy/DNS prüfen)."

Powered by TurnKey Linux.