Phase 0 scaffold plus everything since: quality negotiation, host-relay, and active drift correction were each built and reverted after real bugs in live use (see PLAN.md for the full account of each). What remains is read-only SyncPlay observability (live drift/playback stats page) and a one-shot manual "sync me to group" action, plus Phase 5 packaging/release tooling (build.yaml, manifest.json generator, Gitea Actions release workflow) to distribute it as a proper plugin repository. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
1.7 KiB
Bash
Executable File
49 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Builds, packages, and updates manifest.json for a tagged release. Used by
|
|
# .github/workflows/release.yml; safe to run locally too for a dry run.
|
|
#
|
|
# Required env vars:
|
|
# VERSION -- e.g. 0.2.0.0 (must match build.yaml's version)
|
|
# SERVER_URL -- e.g. https://gitea.mrcynic.site
|
|
# REPO_OWNER -- Gitea org/user the repo lives under
|
|
# REPO_NAME -- Gitea repo name
|
|
set -euo pipefail
|
|
|
|
: "${VERSION:?VERSION env var required, e.g. 0.2.0.0}"
|
|
: "${SERVER_URL:?SERVER_URL env var required, e.g. https://gitea.mrcynic.site}"
|
|
: "${REPO_OWNER:?REPO_OWNER env var required}"
|
|
: "${REPO_NAME:?REPO_NAME env var required}"
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
echo "Building Release configuration..."
|
|
dotnet build src/JellyfinSyncPlus/JellyfinSyncPlus.csproj -c Release
|
|
|
|
BUILD_VERSION=$(grep -oP '(?<=^version: ")[^"]*' build.yaml)
|
|
if [ "$BUILD_VERSION" != "$VERSION" ]; then
|
|
echo "ERROR: build.yaml version ($BUILD_VERSION) does not match requested VERSION ($VERSION)." >&2
|
|
echo "Update build.yaml's version field to match the git tag before releasing." >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p release
|
|
ZIP_NAME="JellyfinSyncPlus_${VERSION}.zip"
|
|
ZIP_PATH="release/${ZIP_NAME}"
|
|
rm -f "$ZIP_PATH"
|
|
(cd src/JellyfinSyncPlus/bin/Release/net9.0 && zip -j "$ROOT/$ZIP_PATH" JellyfinSyncPlus.dll)
|
|
|
|
CHECKSUM=$(md5sum "$ZIP_PATH" | awk '{print $1}')
|
|
SOURCE_URL="${SERVER_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/v${VERSION}/${ZIP_NAME}"
|
|
|
|
python3 "$ROOT/dev/update_manifest.py" \
|
|
--build-yaml "$ROOT/build.yaml" \
|
|
--manifest "$ROOT/manifest.json" \
|
|
--version "$VERSION" \
|
|
--checksum "$CHECKSUM" \
|
|
--source-url "$SOURCE_URL"
|
|
|
|
echo "Packaged $ZIP_PATH"
|
|
echo "Checksum: $CHECKSUM"
|
|
echo "Source URL: $SOURCE_URL"
|