|
| 1 | +name: Publish Moonbase Cinema Skip sync test release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - release/moonbase-2.4.0.10-cinema-skip-sync |
| 7 | + paths: |
| 8 | + - '.github/workflows/publish-cinema-skip-sync.yml' |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + publish: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 30 |
| 17 | + env: |
| 18 | + SOURCE_SHA: ce0e5cfe096c5dceb5fd1fc42483b0e7194b9256 |
| 19 | + VERSION: 2.4.0.10 |
| 20 | + RELEASE_TAG: test-2.4.0.10 |
| 21 | + GH_TOKEN: ${{ github.token }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + ref: ce0e5cfe096c5dceb5fd1fc42483b0e7194b9256 |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Verify source and unused release tag |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + set -euo pipefail |
| 32 | + test "$(git rev-parse HEAD)" = "$SOURCE_SHA" |
| 33 | + if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then |
| 34 | + echo "::error::Release already exists; refusing to overwrite" |
| 35 | + exit 1 |
| 36 | + fi |
| 37 | + if git ls-remote --exit-code --tags origin "refs/tags/$RELEASE_TAG" >/dev/null; then |
| 38 | + echo "::error::Tag already exists; refusing to overwrite" |
| 39 | + exit 1 |
| 40 | + fi |
| 41 | +
|
| 42 | + - uses: actions/setup-dotnet@v4 |
| 43 | + with: |
| 44 | + dotnet-version: 8.0.x |
| 45 | + |
| 46 | + - name: Run Jellyfin tests |
| 47 | + run: dotnet test Jellyfin/tests/Moonfin.Server.Tests/Moonfin.Server.Tests.csproj -c Release --nologo |
| 48 | + |
| 49 | + - name: Run Emby tests |
| 50 | + run: dotnet test Emby/tests/Emby.Plugins.Moonfin.Tests/Emby.Plugins.Moonfin.Tests.csproj -c Release --nologo |
| 51 | + |
| 52 | + - name: Run salvage tests |
| 53 | + run: dotnet run --project Jellyfin/tools/salvage-tests -c Release |
| 54 | + |
| 55 | + - name: Build versioned plugin packages |
| 56 | + shell: bash |
| 57 | + run: | |
| 58 | + set -euo pipefail |
| 59 | + SKIP_MANIFEST_UPDATE=1 bash Jellyfin/build.sh "$VERSION" 10.10.0 |
| 60 | + (cd Emby && bash build.sh "$VERSION") |
| 61 | +
|
| 62 | + - name: Validate archives and write install catalog |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + set -euo pipefail |
| 66 | + JF="Jellyfin/Moonfin.Server-$VERSION.zip" |
| 67 | + EMBY="Emby/Moonfin.Emby-$VERSION.zip" |
| 68 | + unzip -t "$JF" >/dev/null |
| 69 | + unzip -t "$EMBY" >/dev/null |
| 70 | + unzip -p "$JF" meta.json | jq -e --arg v "$VERSION" '.version == $v and .targetAbi == "10.10.0.0" and .guid == "8c5d0e91-4f2a-4b6d-9e3f-1a7c8d9e0f2b"' >/dev/null |
| 71 | + unzip -Z -1 "$JF" | grep -Fx 'Moonfin.Server.dll' |
| 72 | + unzip -Z -1 "$JF" | grep -Fx 'SharpCompress.dll' |
| 73 | + unzip -Z -1 "$EMBY" | grep -Fx 'Emby.Plugins.Moonfin.dll' |
| 74 | + unzip -Z -1 "$EMBY" | grep -Fx 'SharpCompress.dll' |
| 75 | + python3 - <<'PY' |
| 76 | + import datetime, hashlib, json, os |
| 77 | + from pathlib import Path |
| 78 | + version = os.environ["VERSION"] |
| 79 | + tag = os.environ["RELEASE_TAG"] |
| 80 | + source = os.environ["SOURCE_SHA"] |
| 81 | + repo = os.environ["GITHUB_REPOSITORY"] |
| 82 | + package = Path("Jellyfin") / f"Moonfin.Server-{version}.zip" |
| 83 | + catalog = json.loads(Path("Jellyfin/manifest.json").read_text()) |
| 84 | + plugin = catalog[0] |
| 85 | + plugin["owner"] = "Roboatlas21" |
| 86 | + plugin["imageUrl"] = f"https://raw.githubusercontent.com/{repo}/{source}/Jellyfin/backend/assets/logo.png" |
| 87 | + plugin["versions"] = [{ |
| 88 | + "version": version, |
| 89 | + "changelog": "Add Cinema Mode Skip Button sync and admin defaults for Moonfin-Core #1945. Built from upstream Moonbase plus the Skip sync branch; older experimental trailer-identification features are not included. Normal Apply Defaults and full overwrite retain their existing behavior. Requires a Moonfin client with the Cinema Mode Skip feature.", |
| 90 | + "targetAbi": "10.10.0.0", |
| 91 | + "sourceUrl": f"https://github.com/{repo}/releases/download/{tag}/{package.name}", |
| 92 | + "checksum": hashlib.md5(package.read_bytes()).hexdigest().upper(), |
| 93 | + "timestamp": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), |
| 94 | + "dependencies": [] |
| 95 | + }] |
| 96 | + Path("cinema-skip-sync-manifest.json").write_text(json.dumps([plugin], indent=2) + "\n") |
| 97 | + checksums = [] |
| 98 | + for path in (package, Path("Emby") / f"Moonfin.Emby-{version}.zip"): |
| 99 | + checksums.append(f"{hashlib.sha256(path.read_bytes()).hexdigest()} {path.name}") |
| 100 | + Path("SHA256SUMS.txt").write_text("\n".join(checksums) + "\n") |
| 101 | + PY |
| 102 | +
|
| 103 | + - name: Publish release |
| 104 | + shell: bash |
| 105 | + run: | |
| 106 | + set -euo pipefail |
| 107 | + cat > "$RUNNER_TEMP/release-notes.md" <<'NOTES' |
| 108 | + Built from feature commit ce0e5cfe096c5dceb5fd1fc42483b0e7194b9256 on feat/cinema-mode-skip-sync. |
| 109 | +
|
| 110 | + Changes: |
| 111 | + - Sync cinemaModeSkipEnabled for Jellyfin and Emby. |
| 112 | + - Add Cinema Mode Skip Button to administrator defaults with Not set / Yes / No. |
| 113 | + - Keep the existing Apply Defaults and full overwrite behavior. |
| 114 | +
|
| 115 | + Installation: |
| 116 | + Add the cinema-skip-sync-manifest.json release asset URL as a Jellyfin plugin repository, install Moonbase 2.4.0.10, and restart Jellyfin. A compatible Moonfin client containing the merged Cinema Mode Skip feature is required. |
| 117 | +
|
| 118 | + This is upstream Moonbase plus the Skip sync change. It does not include the older experimental trailer-identification/Seerr resolver feature branch. The ZIPs contain the server plugins; they do not bundle the Flutter web client. Hosted-relay mobile push needs the official relay key; no private relay key is included in this fork build. |
| 119 | +
|
| 120 | + Validation: |
| 121 | + Full Jellyfin and Emby unit suites, salvage tests, plugin builds, assembly verification, and ZIP integrity checks passed before publication. |
| 122 | +
|
| 123 | + Release packaging is isolated on a separate release branch. The feature branch, its version files, master, and the existing test catalog are unchanged. |
| 124 | + NOTES |
| 125 | + gh release create "$RELEASE_TAG" \ |
| 126 | + "Jellyfin/Moonfin.Server-$VERSION.zip" \ |
| 127 | + "Emby/Moonfin.Emby-$VERSION.zip" \ |
| 128 | + cinema-skip-sync-manifest.json SHA256SUMS.txt \ |
| 129 | + --target "$SOURCE_SHA" \ |
| 130 | + --title "Moonbase $VERSION - Cinema Mode Skip sync (test)" \ |
| 131 | + --notes-file "$RUNNER_TEMP/release-notes.md" \ |
| 132 | + --prerelease --latest=false |
| 133 | +
|
| 134 | + - name: Verify release and feature branch |
| 135 | + shell: bash |
| 136 | + run: | |
| 137 | + set -euo pipefail |
| 138 | + gh release view "$RELEASE_TAG" --json tagName,isPrerelease,assets,targetCommitish > "$RUNNER_TEMP/release.json" |
| 139 | + jq -e --arg tag "$RELEASE_TAG" --arg sha "$SOURCE_SHA" --arg v "$VERSION" ' |
| 140 | + .tagName == $tag and .isPrerelease == true and .targetCommitish == $sha |
| 141 | + and ([.assets[].name] | index("Moonfin.Server-" + $v + ".zip") != null) |
| 142 | + and ([.assets[].name] | index("Moonfin.Emby-" + $v + ".zip") != null) |
| 143 | + and ([.assets[].name] | index("cinema-skip-sync-manifest.json") != null) |
| 144 | + ' "$RUNNER_TEMP/release.json" >/dev/null |
| 145 | + test "$(git ls-remote origin refs/heads/feat/cinema-mode-skip-sync | cut -f1)" = "$SOURCE_SHA" |
0 commit comments