Add Jellyfin 12.0 release build alongside 10.11
Build Plugin / build (push) Failing after 1m1s
Release Plugin / build-and-release (push) Failing after 3m22s

Multi-target the plugin against net9.0 (Jellyfin 10.11.x) and net10.0
(Jellyfin 12.0.x), with per-framework Jellyfin.Controller/Model references.

Jellyfin 12 added a controlling-session parameter to
ISessionManager.ReportCapabilities; an empty value skips the AssertCanControl
check, which is what a server-side registration needs.

Each release now ships two packages, jellylms_<version>_jf11.zip and
jellylms_<version>_jf12.zip, with a manifest entry each. Jellyfin filters by
targetAbi, so both can share a version number. Also corrects the manifest
targetAbi for new releases from 10.10.0.0 to 10.11.0.0 - the plugin has
referenced 10.11 packages since 1.0.0.

jprm only reads ./build.yaml, so build-plugin.sh swaps targetAbi/framework per
variant and restores the file afterwards.

The builder image moves to the .NET 10 SDK, which targets both frameworks.
CA1873 (new in that SDK) is disabled alongside CA1848, same rationale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-08 18:48:16 +02:00
co-authored by Claude Opus 5
parent e69f57d7ee
commit 71180941e5
8 changed files with 161 additions and 78 deletions
+53
View File
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
#
# Package the JellyLMS plugin for one Jellyfin server generation.
#
# ./build-plugin.sh jf11 [version] -> Jellyfin 10.11.x, net9.0
# ./build-plugin.sh jf12 [version] -> Jellyfin 12.0.x, net10.0
#
# jprm always reads ./build.yaml, so this temporarily rewrites the targetAbi and
# framework fields for the requested variant and restores the file afterwards.
# The resulting zip is written to artifacts/ with a variant suffix, and its path
# is printed on stdout.
set -euo pipefail
VARIANT="${1:-}"
VERSION="${2:-}"
case "${VARIANT}" in
jf11) TARGET_ABI="10.11.0.0"; FRAMEWORK="net9.0" ;;
jf12) TARGET_ABI="12.0.0.0"; FRAMEWORK="net10.0" ;;
*) echo "usage: $0 <jf11|jf12> [version]" >&2; exit 1 ;;
esac
cd "$(dirname "$0")"
if [ -z "${VERSION}" ]; then
VERSION=$(sed -n 's/^version:[[:space:]]*"\{0,1\}\([^"]*\)"\{0,1\}[[:space:]]*$/\1/p' build.yaml)
fi
# jprm normalises the version to four components for the artifact name.
FULL_VERSION="${VERSION}"
while [ "$(printf '%s' "${FULL_VERSION}" | tr -cd '.' | wc -c)" -lt 3 ]; do
FULL_VERSION="${FULL_VERSION}.0"
done
BACKUP=$(mktemp)
cp build.yaml "${BACKUP}"
trap 'cp "${BACKUP}" build.yaml; rm -f "${BACKUP}"' EXIT
sed -i "s/^version:.*/version: \"${VERSION}\"/" build.yaml
sed -i "s/^targetAbi:.*/targetAbi: \"${TARGET_ABI}\"/" build.yaml
sed -i "s/^framework:.*/framework: \"${FRAMEWORK}\"/" build.yaml
echo "Building ${VARIANT}: targetAbi=${TARGET_ABI} framework=${FRAMEWORK} version=${VERSION}" >&2
mkdir -p "artifacts/${VARIANT}"
jprm --verbosity=debug plugin build ./ --output "artifacts/${VARIANT}" >&2
SRC="artifacts/${VARIANT}/jellylms_${FULL_VERSION}.zip"
DEST="artifacts/jellylms_${FULL_VERSION}_${VARIANT}.zip"
mv "${SRC}" "${DEST}"
rm -rf "artifacts/${VARIANT}"
echo "${DEST}"