update
This commit is contained in:
+2
-1
@@ -31,10 +31,11 @@ Outputs land under `out/`:
|
||||
|
||||
```
|
||||
out/peardata-server-linux-x64/peardata-server
|
||||
out/peardata-linux-x64/peardata-client
|
||||
out/peardata-linux-x64/peardata-client # Electron (folder name = package.json name)
|
||||
out/peardata-darwin-arm64/peardata.app # macOS
|
||||
```
|
||||
|
||||
|
||||
Env knobs:
|
||||
|
||||
| Env | Default | Meaning |
|
||||
|
||||
+3
-1
@@ -10,7 +10,9 @@ const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const pkg = require('./package.json')
|
||||
const appName = pkg.productName || pkg.name || 'PearData'
|
||||
// Use lowercase package name for out/<name>-<host>/ so release staging is stable.
|
||||
// productName (PearData) remains the display name in package.json / UI.
|
||||
const appName = pkg.name || 'peardata'
|
||||
|
||||
/**
|
||||
* Resolve packaging target from forge CLI args or env (set by make.cjs).
|
||||
|
||||
@@ -108,17 +108,48 @@ stage_server() {
|
||||
log "staged $archive"
|
||||
}
|
||||
|
||||
find_client_dir() {
|
||||
local host="$1"
|
||||
# Prefer stable lowercase out/peardata-<host> (forge packagerConfig.name).
|
||||
# Also accept legacy PearData-<host> / productName variants from older builds.
|
||||
local candidates=(
|
||||
"$ROOT/out/peardata-$host"
|
||||
"$ROOT/out/PearData-$host"
|
||||
"$ROOT/out/peardata-client-$host"
|
||||
)
|
||||
local d
|
||||
for d in "${candidates[@]}"; do
|
||||
if [[ -d "$d" ]]; then
|
||||
echo "$d"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
# Last resort: any out/*-<host> Electron package (exclude Bare server dirs)
|
||||
while IFS= read -r d; do
|
||||
[[ -z "$d" ]] && continue
|
||||
case "$(basename "$d")" in
|
||||
peardata-server-*) continue ;;
|
||||
esac
|
||||
echo "$d"
|
||||
return 0
|
||||
done < <(find "$ROOT/out" -maxdepth 1 -type d -name "*-$host" 2>/dev/null | sort)
|
||||
return 1
|
||||
}
|
||||
|
||||
stage_client() {
|
||||
local host="$1"
|
||||
local dir="$ROOT/out/peardata-$host"
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
log "WARN: missing client dir $dir"
|
||||
local dir
|
||||
if ! dir="$(find_client_dir "$host")"; then
|
||||
log "WARN: missing client dir for $host (looked under out/*-$host)"
|
||||
ls -la "$ROOT/out" 2>/dev/null || true
|
||||
return 1
|
||||
fi
|
||||
local leaf
|
||||
leaf="$(basename "$dir")"
|
||||
local archive="peardata-client-${VERSION}-${host}.tar.gz"
|
||||
tar -C "$ROOT/out" -czf "$DIST/$archive" "peardata-$host"
|
||||
tar -C "$ROOT/out" -czf "$DIST/$archive" "$leaf"
|
||||
(cd "$DIST" && sha_file "$archive" >"${archive}.sha256")
|
||||
log "staged $archive"
|
||||
log "staged $archive (from $leaf)"
|
||||
}
|
||||
|
||||
SERVER_OK=0
|
||||
@@ -167,11 +198,12 @@ tar -xzf peardata-server-${VERSION}-linux-x64.tar.gz
|
||||
|
||||
\`\`\`bash
|
||||
tar -xzf peardata-client-${VERSION}-darwin-arm64.tar.gz
|
||||
open peardata-darwin-arm64/peardata.app # macOS
|
||||
open peardata-darwin-arm64/peardata.app # macOS (.app name follows packager name)
|
||||
# Linux: ./peardata-linux-x64/peardata-client
|
||||
# Windows: peardata-win32-x64\\\\peardata-client.exe
|
||||
\`\`\`
|
||||
|
||||
|
||||
macOS clients are codesigned in CI (ad-hoc / self-signed via \`rcodesign\` on Linux)
|
||||
to avoid Gatekeeper "**damaged**" false positives. First open may still need
|
||||
right-click → Open unless notarized with Developer ID.
|
||||
@@ -190,6 +222,12 @@ if [[ "$SERVER_OK" -eq 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${PEARDATA_SKIP_CLIENT:-0}" != "1" && "$CLIENT_OK" -eq 0 ]]; then
|
||||
log "ERROR: no client artifacts staged (clients were not skipped)"
|
||||
log "HINT: forge should write out/peardata-<host>/; check make:client logs above"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${DRY_RUN:-0}" == "1" ]]; then
|
||||
log "DRY_RUN=1 — skip Gitea upload"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user