Skip to content

feat-settings-sync - Allow for Custom Home Rows Sync across devices #247

feat-settings-sync - Allow for Custom Home Rows Sync across devices

feat-settings-sync - Allow for Custom Home Rows Sync across devices #247

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build:
name: Build Plugins
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build Jellyfin plugin
id: backend_build
continue-on-error: true
run: |
set -o pipefail
rm -rf Jellyfin/backend/bin/Release Jellyfin/backend/obj/Release
rm -rf Jellyfin/tools/verify-plugin/bin/Release Jellyfin/tools/verify-plugin/obj/Release
dotnet publish Jellyfin/backend/Moonfin.Server.csproj \
-c Release \
-o Jellyfin/backend/bin/Release/net8.0/publish \
2>&1 | tee "${{ runner.temp }}/backend-build.log"
dotnet run --project Jellyfin/tools/verify-plugin/VerifyPlugin.csproj \
-c Release -- \
Jellyfin/backend/bin/Release/net8.0/publish/Moonfin.Server.dll \
2>&1 | tee -a "${{ runner.temp }}/backend-build.log"
- name: Build Emby plugin
id: emby_build
continue-on-error: true
run: |
set -o pipefail
EMBY_VERSION=$(grep -oPm1 '(?<=<AssemblyVersion>)[^<]+' Emby/Emby.Plugins.Moonfin/Emby.Plugins.Moonfin.csproj)
echo "version=$EMBY_VERSION" >> "$GITHUB_OUTPUT"
echo "zip_name=Moonfin.Emby-${EMBY_VERSION}.zip" >> "$GITHUB_OUTPUT"
# build.sh builds the netstandard2.1 plugin and assembles the drop-in zip.
cd Emby
bash build.sh "$EMBY_VERSION" 2>&1 | tee "${{ runner.temp }}/emby-build.log"
- name: Fail if any build failed
if: steps.backend_build.outcome != 'success' || steps.emby_build.outcome != 'success'
run: exit 1
- name: Save build results
if: always() && github.event_name == 'pull_request'
run: |
mkdir -p "${{ runner.temp }}/build-results"
cat > "${{ runner.temp }}/build-results/outcomes.json" <<EOF
{
"pr_number": ${{ github.event.pull_request.number }},
"sha": "${{ github.event.pull_request.head.sha }}",
"backend_build": "${{ steps.backend_build.outcome }}",
"emby_build": "${{ steps.emby_build.outcome }}"
}
EOF
for log in backend-build.log emby-build.log; do
if [ -f "${{ runner.temp }}/$log" ]; then
cp "${{ runner.temp }}/$log" "${{ runner.temp }}/build-results/"
fi
done
- name: Upload build results
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: build-results
path: ${{ runner.temp }}/build-results/
- name: Read Jellyfin version and ABI
if: github.event_name == 'push' && steps.backend_build.outcome == 'success' && steps.emby_build.outcome == 'success'
id: jf_meta
run: |
VERSION=$(grep -oPm1 '(?<=<AssemblyVersion>)[^<]+' Jellyfin/backend/Moonfin.Server.csproj)
ABI=$(grep 'Jellyfin.Controller' Jellyfin/backend/Moonfin.Server.csproj | grep -oP 'Version="\K[^"]+')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "abi=${ABI}.0" >> "$GITHUB_OUTPUT"
- name: Package Jellyfin ZIP
if: github.event_name == 'push' && steps.backend_build.outcome == 'success' && steps.emby_build.outcome == 'success'
id: jf_package
run: |
VERSION="${{ steps.jf_meta.outputs.version }}"
TARGET_ABI="${{ steps.jf_meta.outputs.abi }}"
PLUGIN_GUID="8c5d0e91-4f2a-4b6d-9e3f-1a7c8d9e0f2b"
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
mkdir -p jellyfin-release
cp Jellyfin/backend/bin/Release/net8.0/publish/Moonfin.Server.dll jellyfin-release/
cp Jellyfin/backend/bin/Release/net8.0/publish/SharpCompress.dll jellyfin-release/
if [ -f Jellyfin/frontend/index.html ]; then
mkdir -p jellyfin-release/frontend
cp -R Jellyfin/frontend/. jellyfin-release/frontend/
rm -rf jellyfin-release/frontend/node_modules
rm -f jellyfin-release/frontend/package.json jellyfin-release/frontend/package-lock.json
fi
cat > jellyfin-release/meta.json <<EOF
{
"category": "General",
"changelog": "",
"description": "Moonfin brings a modern TV-style UI to Jellyfin web. Features include: custom navbar, media bar with featured content, Jellyseerr integration, and cross-device settings synchronization.",
"guid": "${PLUGIN_GUID}",
"name": "Moonfin",
"overview": "Custom UI and settings sync for Jellyfin",
"owner": "RadicalMuffinMan",
"targetAbi": "${TARGET_ABI}",
"timestamp": "${TIMESTAMP}",
"version": "${VERSION}",
"status": "Active",
"autoUpdate": true,
"assemblies": ["Moonfin.Server.dll"]
}
EOF
ZIP_NAME="Moonfin.Server-${VERSION}.zip"
cd jellyfin-release && zip -r "../${ZIP_NAME}" . && cd ..
CHECKSUM=$(md5sum "$ZIP_NAME" | awk '{print toupper($1)}')
echo "zip_name=$ZIP_NAME" >> "$GITHUB_OUTPUT"
echo "checksum=$CHECKSUM" >> "$GITHUB_OUTPUT"
- name: Upload Jellyfin artifact
if: github.event_name == 'push' && steps.backend_build.outcome == 'success' && steps.emby_build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.jf_package.outputs.zip_name }}
path: ${{ steps.jf_package.outputs.zip_name }}
- name: Upload Emby artifact
if: github.event_name == 'push' && steps.backend_build.outcome == 'success' && steps.emby_build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.emby_build.outputs.zip_name }}
path: Emby/${{ steps.emby_build.outputs.zip_name }}
- name: Build summary (master)
if: github.event_name == 'push' && steps.backend_build.outcome == 'success' && steps.emby_build.outcome == 'success'
run: |
echo "## Build Successful" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Plugin | Version | Artifact |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Jellyfin** | \`${{ steps.jf_meta.outputs.version }}\` | \`${{ steps.jf_package.outputs.zip_name }}\` (MD5 \`${{ steps.jf_package.outputs.checksum }}\`) |" >> $GITHUB_STEP_SUMMARY
echo "| **Emby** | \`${{ steps.emby_build.outputs.version }}\` | \`${{ steps.emby_build.outputs.zip_name }}\` |" >> $GITHUB_STEP_SUMMARY