#!/usr/bin/env bash set -euo pipefail # Publish this machine's built artifacts into the served flat download folder. # # Run from the repo root AFTER building for this host's target, e.g.: # bun scripts/release.ts # or --target mac-x64 / win-x64 # site/deploy.sh # # electrobun cannot cross-compile, so each OS/arch is built (and deployed) on its # own machine; every run just adds/overwrites that target's files in one flat dir. # Installers keep stable names (overwrite in place); .patch files accumulate — never # delete old ones, or users on older versions lose their incremental update trail. # # Serving locally? Leave MINISCP_DL_DIR unset (defaults to /srv/miniscp/dl). # Serving on a remote box? Point MINISCP_DL_DIR at a local staging dir, then rsync: # MINISCP_DL_DIR=./_dl site/deploy.sh # rsync -av ./_dl/ user@host:/srv/miniscp/dl/ dl="${MINISCP_DL_DIR:-/srv/miniscp/dl}" mkdir -p "$dl" # electrobun's flat artifacts (stable---*): installers, update payloads, # update.json, and (once release.baseUrl is set) .patch files. if compgen -G 'artifacts/stable-*' >/dev/null; then cp -f artifacts/stable-* "$dl"/ else echo "deploy: WARN — no artifacts/stable-* found (did scripts/release.ts run?)" >&2 fi # Windows portable zip is a release.ts extra (build-numbered) → give it a stable name. port=$(ls -1 release/win-x64/*-win-x64-portable.zip 2>/dev/null | head -n1 || true) if [ -n "$port" ]; then cp -f "$port" "$dl/stable-win-x64-miniSCP-portable.zip" fi echo "Published to $dl:" ls -1 "$dl"