MovieMapper/scripts/publish-release.sh
Jarian Cottingham 43114cfe3c feat: release packaging — electron-builder installers + release pipeline
- electron-builder config: AppImage/deb (linux), dmg (mac), nsis (win)
- app icon, desktopName sync, deb maintainer metadata
- move electron to devDependencies; add author/license/repo metadata
- pin @noble/hashes 1.8.0 (electron-builder 26 ESM conflict)
- .github/workflows/release.yml: tag-triggered multi-OS build + release
- scripts/publish-release.sh: upload dist/ assets to a Gitea release
- README: installation + installer build instructions
- add missing .env.example
- verified locally: AppImage + deb build, deb structure checks out,
  118 JS tests still green
2026-08-20 20:46:35 +00:00

54 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Publish built artifacts (dist/) as a Gitea release with attached assets.
#
# Usage:
# GITEA_PASS=... ./scripts/publish-release.sh v1.0.0
#
# Environment:
# GITEA_URL (default: https://git.home.ms)
# GITEA_USER (default: jarianc)
# GITEA_PASS (required)
# GITEA_REPO (default: jarianc/MovieMapper)
set -euo pipefail
TAG="${1:?usage: publish-release.sh <tag> (e.g. v1.0.0)}"
GITEA_URL="${GITEA_URL:-https://git.home.ms}"
GITEA_USER="${GITEA_USER:-jarianc}"
GITEA_PASS="${GITEA_PASS:?GITEA_PASS is required}"
GITEA_REPO="${GITEA_REPO:-jarianc/MovieMapper}"
AUTH=("${GITEA_USER}:${GITEA_PASS}")
API="$GITEA_URL/api/v1/repos/$GITEA_REPO"
# Create the release if it does not exist yet.
existing="$(curl -sf -u "${AUTH[@]}" "$API/releases/tags/$TAG" 2>/dev/null \
| python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' || true)"
if [ -z "${existing}" ]; then
curl -sf -u "${AUTH[@]}" -X POST "$API/releases" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"MovieMapper $TAG release. Linux: AppImage + deb. See README for install instructions.\"}" \
> /dev/null
echo "created release $TAG"
fi
uploaded=0
for f in dist/*.AppImage dist/*.deb dist/*.dmg dist/*.exe dist/*.zip; do
[ -e "$f" ] || continue
if curl -sf -u "${AUTH[@]}" -X POST "$API/releases/$TAG/assets" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$f" > /dev/null; then
echo "uploaded $(basename "$f")"
uploaded=$((uploaded + 1))
else
echo "FAILED to upload $f" >&2
exit 1
fi
done
if [ "$uploaded" -eq 0 ]; then
echo "no artifacts found in dist/ — run npm run dist first" >&2
exit 1
fi
echo "done: $uploaded assets on release $TAG"