Support multiple Jellyfin versions (10.11 and 12.0) via multi-targeting

This commit is contained in:
2026-09-17 15:11:54 +02:00
parent b46e5e1786
commit 18b4a71a2f
2 changed files with 43 additions and 15 deletions
+36 -12
View File
@@ -22,16 +22,27 @@ jobs:
- name: Build Plugin - name: Build Plugin
run: dotnet build JellyfinPlugin/JellyfinPlugin.csproj -c Release run: dotnet build JellyfinPlugin/JellyfinPlugin.csproj -c Release
- name: Create ZIP Archive - name: Create ZIP Archives
run: | run: |
cd JellyfinPlugin/bin/Release/net9.0/ cd JellyfinPlugin/bin/Release/
zip -j ../../../../BlackBarRemover_${{ github.ref_name }}.zip *
# Zip net9.0 (Jellyfin 10.11)
cd net9.0
zip -j ../../../../BlackBarRemover_${{ github.ref_name }}_jf10.11.zip *
cd ..
# Zip net10.0 (Jellyfin 12.0)
cd net10.0
zip -j ../../../../BlackBarRemover_${{ github.ref_name }}_jf12.0.zip *
cd ..
- name: Generate Checksum - name: Generate Checksums
id: checksum id: checksum
run: | run: |
MD5_SUM=$(md5sum BlackBarRemover_${{ github.ref_name }}.zip | awk '{print $1}') MD5_SUM_9=$(md5sum BlackBarRemover_${{ github.ref_name }}_jf10.11.zip | awk '{print $1}')
echo "md5=$MD5_SUM" >> $GITHUB_OUTPUT MD5_SUM_10=$(md5sum BlackBarRemover_${{ github.ref_name }}_jf12.0.zip | awk '{print $1}')
echo "md5_9=$MD5_SUM_9" >> $GITHUB_OUTPUT
echo "md5_10=$MD5_SUM_10" >> $GITHUB_OUTPUT
- name: Create Gitea Release - name: Create Gitea Release
run: | run: |
@@ -53,10 +64,14 @@ jobs:
REL_ID=$(echo "$RELEASE_RES" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) REL_ID=$(echo "$RELEASE_RES" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
# Upload Asset # Upload Assets
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \ curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \ -H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_$TAG.zip" -F "attachment=@BlackBarRemover_${TAG}_jf10.11.zip"
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip"
- name: Update manifest.json - name: Update manifest.json
run: | run: |
@@ -66,7 +81,7 @@ jobs:
git checkout -B manifest git checkout -B manifest
VERSION="${{ github.ref_name }}" VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}" # remove 'v' prefix VERSION="${VERSION#v}"
cat > manifest.json <<EOF cat > manifest.json <<EOF
[ [
@@ -81,12 +96,21 @@ jobs:
"versions": [ "versions": [
{ {
"version": "$VERSION", "version": "$VERSION",
"changelog": "Automated Release ${{ github.ref_name }}", "changelog": "Automated Release ${{ github.ref_name }} (Jellyfin 12.0)",
"targetAbi": "12.0.0.0", "targetAbi": "12.0.0.0",
"sourceUrl": "https://gitea.labus.uk/karol/blackBarRemover", "sourceUrl": "https://gitea.labus.uk/karol/blackBarRemover",
"checksum": "${{ steps.checksum.outputs.md5 }}", "checksum": "${{ steps.checksum.outputs.md5_10 }}",
"timestamp": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')", "timestamp": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')",
"repositoryUrl": "https://gitea.labus.uk/karol/blackBarRemover/releases/download/${{ github.ref_name }}/BlackBarRemover_${{ github.ref_name }}.zip" "repositoryUrl": "https://gitea.labus.uk/karol/blackBarRemover/releases/download/${{ github.ref_name }}/BlackBarRemover_${{ github.ref_name }}_jf12.0.zip"
},
{
"version": "$VERSION",
"changelog": "Automated Release ${{ github.ref_name }} (Jellyfin 10.11)",
"targetAbi": "10.11.0.0",
"sourceUrl": "https://gitea.labus.uk/karol/blackBarRemover",
"checksum": "${{ steps.checksum.outputs.md5_9 }}",
"timestamp": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')",
"repositoryUrl": "https://gitea.labus.uk/karol/blackBarRemover/releases/download/${{ github.ref_name }}/BlackBarRemover_${{ github.ref_name }}_jf10.11.zip"
} }
] ]
} }
+7 -3
View File
@@ -1,19 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net9.0</TargetFramework> <TargetFrameworks>net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<!-- Zależności Jellyfin -->
<PackageReference Include="Jellyfin.Controller" Version="10.11.2" /> <PackageReference Include="Jellyfin.Controller" Version="10.11.2" />
<PackageReference Include="Jellyfin.Model" Version="10.11.2" /> <PackageReference Include="Jellyfin.Model" Version="10.11.2" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Jellyfin.Controller" Version="12.0.0" />
<PackageReference Include="Jellyfin.Model" Version="12.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>