Skip to content

Commit bc85f84

Browse files
overhauled the plugin interface completely. removed front end overlay, improved settings sync across clients, updated admin panel with full settings sync for global profile and the ability to send messages to all clients, and built in theme editor from within the flutter web client built from the Moonfin-Core repo
1 parent 56141a6 commit bc85f84

57 files changed

Lines changed: 5969 additions & 23414 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,3 @@
1-
# ─────────────────────────────────────────────────────────────
2-
# Moonfin Plugin — CI Build Workflow
3-
# ─────────────────────────────────────────────────────────────
4-
#
5-
# Triggers:
6-
# • Push to master → build + package ZIP artifact
7-
# • PR to master → build + upload result artifact
8-
#
9-
# Security:
10-
# Uses pull_request (not pull_request_target) so untrusted fork
11-
# code never runs with write access. PR comments are posted by
12-
# a separate workflow (comment.yml) triggered via workflow_run.
13-
#
14-
# Build flow:
15-
# 1. Frontend install (npm ci)
16-
# 2. Frontend build (node build.js) — skipped if (1) fails
17-
# 3. Sync web files (cp to backend/Web/) — skipped if (2) fails
18-
# 4. Backend build (dotnet build) — skipped if (2) fails
19-
# 5. Gate step — fails the job if any of (1)-(4) didn't succeed
20-
#
21-
# Error handling:
22-
# Build steps (1), (2), (4) use continue-on-error so the job keeps
23-
# running even on failure. Their output is captured to log files via
24-
# tee. The gate step (5) re-fails the job so the overall status is
25-
# correct. On PRs, build results (outcomes + logs) are uploaded as
26-
# an artifact for the comment.yml workflow to pick up.
27-
#
28-
# Packaging (master only, after successful build):
29-
# Reads version + ABI from the .csproj, creates a release ZIP with
30-
# the DLL + meta.json, and uploads it as a workflow artifact.
31-
# ─────────────────────────────────────────────────────────────
32-
331
name: Build
342

353
on:
@@ -50,73 +18,22 @@ jobs:
5018
- name: Checkout
5119
uses: actions/checkout@v4
5220

53-
- name: Setup Node.js
54-
uses: actions/setup-node@v4
55-
with:
56-
node-version: 20
57-
5821
- name: Setup .NET
5922
uses: actions/setup-dotnet@v4
6023
with:
6124
dotnet-version: 8.0.x
6225

63-
# ── Frontend ──────────────────────────────────────────────
64-
# continue-on-error: lets the job continue so we can upload
65-
# build results even when a step fails.
66-
# set -o pipefail: ensures the pipe returns the command's exit
67-
# code, not tee's (which always succeeds).
68-
# 2>&1 | tee: captures stdout+stderr to a log file for the
69-
# PR comment, while still printing to the Actions console.
70-
- name: Install frontend dependencies
71-
id: frontend_install
72-
continue-on-error: true
73-
working-directory: frontend
74-
run: |
75-
set -o pipefail
76-
npm ci 2>&1 | tee "${{ runner.temp }}/frontend-install.log"
77-
78-
- name: Build frontend
79-
if: steps.frontend_install.outcome == 'success'
80-
id: frontend_build
81-
continue-on-error: true
82-
working-directory: frontend
83-
run: |
84-
set -o pipefail
85-
node build.js 2>&1 | tee "${{ runner.temp }}/frontend-build.log"
86-
87-
# ── Sync web files into backend ───────────────────────────
88-
- name: Sync web files
89-
if: steps.frontend_build.outcome == 'success'
90-
run: |
91-
mkdir -p backend/Web
92-
cp frontend/dist/plugin.js backend/Web/plugin.js
93-
cp frontend/dist/plugin.css backend/Web/plugin.css
94-
95-
# ── Backend ───────────────────────────────────────────────
9626
- name: Build backend
97-
if: steps.frontend_build.outcome == 'success'
9827
id: backend_build
9928
continue-on-error: true
10029
run: |
10130
set -o pipefail
10231
dotnet build backend/Moonfin.Server.csproj -c Release 2>&1 | tee "${{ runner.temp }}/backend-build.log"
10332
104-
# ── Gate ───────────────────────────────────────────────────
105-
# continue-on-error masks failures from the job status. This
106-
# gate step re-fails the job when any build step didn't
107-
# succeed (covers both 'failure' and 'skipped' outcomes).
10833
- name: Fail if build failed
109-
id: build_gate
110-
if: |
111-
steps.frontend_install.outcome != 'success' ||
112-
steps.frontend_build.outcome != 'success' ||
113-
steps.backend_build.outcome != 'success'
34+
if: steps.backend_build.outcome != 'success'
11435
run: exit 1
11536

116-
# ── Upload build results for PR comment workflow ──────────
117-
# Always runs on PRs so the comment.yml workflow can post
118-
# results even on failure. Writes step outcomes + PR number
119-
# to a metadata file alongside the log files.
12037
- name: Save build results
12138
if: always() && github.event_name == 'pull_request'
12239
run: |
@@ -126,16 +43,13 @@ jobs:
12643
{
12744
"pr_number": ${{ github.event.pull_request.number }},
12845
"sha": "${{ github.event.pull_request.head.sha }}",
129-
"frontend_install": "${{ steps.frontend_install.outcome }}",
130-
"frontend_build": "${{ steps.frontend_build.outcome }}",
13146
"backend_build": "${{ steps.backend_build.outcome }}"
13247
}
13348
EOF
13449
135-
# Copy any log files that exist
136-
for f in frontend-install.log frontend-build.log backend-build.log; do
137-
[ -f "${{ runner.temp }}/$f" ] && cp "${{ runner.temp }}/$f" "${{ runner.temp }}/build-results/"
138-
done
50+
if [ -f "${{ runner.temp }}/backend-build.log" ]; then
51+
cp "${{ runner.temp }}/backend-build.log" "${{ runner.temp }}/build-results/"
52+
fi
13953
14054
- name: Upload build results
14155
if: always() && github.event_name == 'pull_request'
@@ -144,7 +58,6 @@ jobs:
14458
name: build-results
14559
path: ${{ runner.temp }}/build-results/
14660

147-
# ── Package (master only) ─────────────────────────────────
14861
- name: Read version from csproj
14962
if: github.event_name == 'push' && steps.backend_build.outcome == 'success'
15063
id: version
@@ -171,6 +84,13 @@ jobs:
17184
mkdir -p release
17285
cp backend/bin/Release/net8.0/Moonfin.Server.dll release/
17386
87+
if [ -f frontend/index.html ]; then
88+
mkdir -p release/frontend
89+
cp -R frontend/. release/frontend/
90+
rm -rf release/frontend/node_modules
91+
rm -f release/frontend/package.json release/frontend/package-lock.json
92+
fi
93+
17494
cat > release/meta.json <<EOF
17595
{
17696
"category": "General",
@@ -208,7 +128,7 @@ jobs:
208128
- name: Build summary (master)
209129
if: github.event_name == 'push' && steps.backend_build.outcome == 'success'
210130
run: |
211-
echo "## Build Successful" >> $GITHUB_STEP_SUMMARY
131+
echo "## Build Successful" >> $GITHUB_STEP_SUMMARY
212132
echo "" >> $GITHUB_STEP_SUMMARY
213133
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
214134
echo "|---|---|" >> $GITHUB_STEP_SUMMARY

.github/workflows/comment.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# ─────────────────────────────────────────────────────────────
2-
# Moonfin Plugin PR Comment Workflow
3-
# ─────────────────────────────────────────────────────────────
1+
# ------------------------------------------------------------
2+
# Moonfin Plugin - PR Comment Workflow
3+
# ------------------------------------------------------------
44
#
55
# Triggered by: workflow_run (after the Build workflow completes)
66
#
77
# Security:
88
# This workflow runs in the context of the base repo and has
99
# write access to PRs. It NEVER checks out or executes code
10-
# from the PR it only reads the build-results artifact
10+
# from the PR - it only reads the build-results artifact
1111
# uploaded by the (read-only) build workflow.
12-
# ─────────────────────────────────────────────────────────────
12+
# ------------------------------------------------------------
1313

1414
name: PR Comment
1515

@@ -55,37 +55,28 @@ jobs:
5555
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.payload.workflow_run.id}`;
5656
5757
const steps = {
58-
'Frontend Install': outcomes.frontend_install,
59-
'Frontend Build': outcomes.frontend_build,
6058
'Backend Build': outcomes.backend_build,
6159
};
62-
const failed = Object.entries(steps).filter(([, v]) => v === 'failure');
63-
const skipped = Object.entries(steps).filter(([, v]) => v === 'skipped');
64-
const success = failed.length === 0 && skipped.length === 0;
60+
const failed = Object.entries(steps).filter(([, v]) => v !== 'success');
61+
const success = failed.length === 0;
6562
6663
const lines = [marker];
6764
6865
if (success) {
6966
lines.push(
70-
'## Build Successful',
67+
'## Build Successful',
7168
'',
7269
'The plugin compiled successfully against **.NET 8** / **Jellyfin 10.10.0**.',
7370
);
7471
} else {
7572
lines.push(
76-
'## Build Failed',
73+
'## Build Failed',
7774
'',
7875
`The following step(s) failed: **${failed.map(([k]) => k).join('**, **')}**`,
7976
);
8077
81-
if (skipped.length > 0) {
82-
lines.push(`Skipped due to earlier failure: ${skipped.map(([k]) => k).join(', ')}`);
83-
}
84-
8578
// Append collapsible log for each failed step
8679
const logFiles = {
87-
'Frontend Install': 'frontend-install.log',
88-
'Frontend Build': 'frontend-build.log',
8980
'Backend Build': 'backend-build.log',
9081
};
9182
@@ -100,7 +91,7 @@ jobs:
10091
10192
lines.push(
10293
'',
103-
`<details><summary>📋 ${name} log (last 50 lines)</summary>`,
94+
`<details><summary>${name} log (last 50 lines)</summary>`,
10495
'',
10596
'```',
10697
log,

.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ artifacts/
2525
# Node
2626
node_modules/
2727

28-
# Frontend build output
29-
frontend/dist/
28+
# Flutter web drop folder
29+
frontend/*
30+
!frontend/.gitkeep
31+
!frontend/theme/
32+
!frontend/theme/**
33+
!frontend/editor/
34+
!frontend/editor/**
3035

3136
# IDE / Editor
3237
.vs/
@@ -50,7 +55,3 @@ frontend/dist/
5055
Thumbs.db
5156
ehthumbs.db
5257
Desktop.ini
53-
54-
# Synced web files (generated by build, not tracked)
55-
backend/Web/plugin.js
56-
backend/Web/plugin.css

0 commit comments

Comments
 (0)