Add Jellyfin 12.0 release build alongside 10.11
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:
@@ -40,23 +40,20 @@ jobs:
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: dotnet build Jellyfin.Plugin.JellyLMS.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||
|
||||
- name: Build Jellyfin Plugin
|
||||
id: jprm
|
||||
- name: Build Jellyfin plugin packages
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
jprm --verbosity=debug plugin build .
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||
LATEST="artifacts/jellylms_latest.zip"
|
||||
cp "${ARTIFACT}" "${LATEST}"
|
||||
echo "artifact=${LATEST}" >> $GITHUB_OUTPUT
|
||||
echo "Found artifact: ${ARTIFACT} -> ${LATEST}"
|
||||
for VARIANT in jf11 jf12; do
|
||||
ARTIFACT=$(./build-plugin.sh "${VARIANT}")
|
||||
cp "${ARTIFACT}" "artifacts/jellylms_latest_${VARIANT}.zip"
|
||||
echo "Built ${VARIANT}: ${ARTIFACT}"
|
||||
done
|
||||
|
||||
- name: Upload build artifact
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jellylms-plugin
|
||||
path: build-${{ github.run_id }}/${{ steps.jprm.outputs.artifact }}
|
||||
path: build-${{ github.run_id }}/artifacts/jellylms_latest_*.zip
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
|
||||
@@ -35,13 +35,6 @@ jobs:
|
||||
echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT
|
||||
echo "Building version: ${VERSION}"
|
||||
|
||||
- name: Update build.yaml with version
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
VERSION="${{ steps.get_version.outputs.version_number }}"
|
||||
sed -i "s/^version:.*/version: \"${VERSION}\"/" build.yaml
|
||||
cat build.yaml
|
||||
|
||||
- name: Cache NuGet packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
@@ -57,17 +50,18 @@ jobs:
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: dotnet build Jellyfin.Plugin.JellyLMS.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||
|
||||
- name: Build Jellyfin Plugin
|
||||
- name: Build Jellyfin plugin packages
|
||||
id: jprm
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
jprm --verbosity=debug plugin build ./
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||
ARTIFACT_NAME=$(basename "${ARTIFACT}")
|
||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||
echo "Found artifact: ${ARTIFACT}"
|
||||
VERSION="${{ steps.get_version.outputs.version_number }}"
|
||||
for VARIANT in jf11 jf12; do
|
||||
ARTIFACT=$(./build-plugin.sh "${VARIANT}" "${VERSION}")
|
||||
echo "${VARIANT}_artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||
echo "${VARIANT}_artifact_name=$(basename "${ARTIFACT}")" >> $GITHUB_OUTPUT
|
||||
echo "${VARIANT}_checksum=$(md5sum "${ARTIFACT}" | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "Built ${VARIANT}: ${ARTIFACT}"
|
||||
done
|
||||
|
||||
- name: Create Release
|
||||
working-directory: release-${{ github.run_id }}
|
||||
@@ -81,11 +75,18 @@ jobs:
|
||||
|
||||
# Create release using Gitea API
|
||||
VERSION="${{ steps.get_version.outputs.version }}"
|
||||
RELEASE_BODY=$(printf '%s\n' \
|
||||
"JellyLMS Jellyfin Plugin ${VERSION}." \
|
||||
"" \
|
||||
"Pick the package matching your server:" \
|
||||
"" \
|
||||
"- \`${{ steps.jprm.outputs.jf11_artifact_name }}\` - Jellyfin 10.11.x" \
|
||||
"- \`${{ steps.jprm.outputs.jf12_artifact_name }}\` - Jellyfin 12.0.x")
|
||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \
|
||||
-d "$(jq -n --arg tag "$VERSION" --arg name "Release $VERSION" --arg body "JellyLMS Jellyfin Plugin ${VERSION}. See attached files for plugin installation." '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')")
|
||||
-d "$(jq -n --arg tag "$VERSION" --arg name "Release $VERSION" --arg body "$RELEASE_BODY" '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')")
|
||||
|
||||
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
||||
@@ -99,33 +100,21 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload plugin artifact
|
||||
echo "Uploading plugin artifact..."
|
||||
curl -f -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary "@${{ steps.jprm.outputs.artifact }}" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=${{ steps.jprm.outputs.artifact_name }}"
|
||||
|
||||
# Upload build.yaml
|
||||
echo "Uploading build.yaml..."
|
||||
curl -f -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/x-yaml" \
|
||||
--data-binary "@build.yaml" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=build.yaml"
|
||||
# Upload plugin artifacts (one per supported Jellyfin generation)
|
||||
for ASSET in \
|
||||
"${{ steps.jprm.outputs.jf11_artifact }}" \
|
||||
"${{ steps.jprm.outputs.jf12_artifact }}"; do
|
||||
echo "Uploading $(basename "${ASSET}")..."
|
||||
curl -f -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary "@${ASSET}" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=$(basename "${ASSET}")"
|
||||
done
|
||||
|
||||
echo "Release created successfully!"
|
||||
echo "View at: ${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/tag/${{ steps.get_version.outputs.version }}"
|
||||
|
||||
- name: Calculate checksum
|
||||
id: checksum
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
CHECKSUM=$(md5sum "${{ steps.jprm.outputs.artifact }}" | awk '{print $1}')
|
||||
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT
|
||||
echo "MD5 checksum: ${CHECKSUM}"
|
||||
|
||||
- name: Update manifest.json
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
@@ -135,30 +124,35 @@ jobs:
|
||||
git checkout master
|
||||
|
||||
VERSION="${{ steps.get_version.outputs.version_number }}"
|
||||
CHECKSUM="${{ steps.checksum.outputs.checksum }}"
|
||||
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
ARTIFACT_NAME="${{ steps.jprm.outputs.artifact_name }}"
|
||||
REPO_OWNER="${{ github.repository_owner }}"
|
||||
REPO_NAME="${{ github.event.repository.name }}"
|
||||
GITEA_URL="${{ github.server_url }}"
|
||||
DOWNLOAD_URL="${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/${{ steps.get_version.outputs.version }}/${ARTIFACT_NAME}"
|
||||
RELEASE_URL="${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/${{ steps.get_version.outputs.version }}"
|
||||
|
||||
# Create the new version entry
|
||||
NEW_VERSION=$(cat <<EOF
|
||||
{
|
||||
"version": "${VERSION}",
|
||||
"changelog": "Release ${VERSION}",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "${DOWNLOAD_URL}",
|
||||
"checksum": "${CHECKSUM}",
|
||||
"timestamp": "${TIMESTAMP}"
|
||||
# One manifest entry per Jellyfin generation. Jellyfin filters the list by
|
||||
# targetAbi, so both entries can share the same version number.
|
||||
add_version() {
|
||||
local abi="$1" artifact_name="$2" checksum="$3"
|
||||
jq \
|
||||
--arg version "${VERSION}" \
|
||||
--arg abi "${abi}" \
|
||||
--arg url "${RELEASE_URL}/${artifact_name}" \
|
||||
--arg checksum "${checksum}" \
|
||||
--arg timestamp "${TIMESTAMP}" \
|
||||
'.[0].versions = [{
|
||||
version: $version,
|
||||
changelog: "Release \($version)",
|
||||
targetAbi: $abi,
|
||||
sourceUrl: $url,
|
||||
checksum: $checksum,
|
||||
timestamp: $timestamp
|
||||
}] + .[0].versions' manifest.json > manifest.tmp.json
|
||||
mv manifest.tmp.json manifest.json
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
# Prepend new version to the versions array in manifest.json
|
||||
jq --argjson newver "${NEW_VERSION}" '.[0].versions = [$newver] + .[0].versions' manifest.json > manifest.tmp.json
|
||||
mv manifest.tmp.json manifest.json
|
||||
add_version "10.11.0.0" "${{ steps.jprm.outputs.jf11_artifact_name }}" "${{ steps.jprm.outputs.jf11_checksum }}"
|
||||
add_version "12.0.0.0" "${{ steps.jprm.outputs.jf12_artifact_name }}" "${{ steps.jprm.outputs.jf12_checksum }}"
|
||||
|
||||
echo "Updated manifest.json:"
|
||||
cat manifest.json
|
||||
|
||||
Reference in New Issue
Block a user