# CI for the playnite workspace (Gitea Actions). # build — the three bun workspaces (contract + plugin + ui): one root install, lint, # per-package typecheck, domain tests, bundle + SPA. Mirrors rom-manager's. # exporter — the C# Playnite extension → a `.pext`, built net462 with the .NET SDK on # Linux (no Windows/MSBuild needed) and uploaded as a workflow artifact. # publish — npm publish to the Gitea registry on a `v*` tag, from plugin/. # @punktfunk/* and @unom/* resolve from the Gitea registry via the root bunfig scope maps # + REGISTRY_TOKEN; everything else (effect, react, tailwind…) comes from npm. name: CI on: push: branches: [main] tags: ['v*'] pull_request: workflow_dispatch: jobs: build: runs-on: ubuntu-24.04 container: image: oven/bun:1 timeout-minutes: 15 steps: # oven/bun's slim base ships neither git nor a CA bundle — actions/checkout's HTTPS fetch needs both. - name: Install git + CA certs run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git nodejs - uses: actions/checkout@v4 - name: Registry auth env: TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | test -n "$TOKEN" || { echo "REGISTRY_TOKEN secret is empty"; exit 1; } printf '//git.unom.io/api/packages/unom/npm/:_authToken=%s\n' "$TOKEN" > "$HOME/.npmrc" - name: Install (workspace) run: bun install --frozen-lockfile - name: Lint & format run: bunx biome check - name: Typecheck (contract) working-directory: contract run: bunx tsc --noEmit - name: Typecheck (plugin) working-directory: plugin run: bunx tsc --noEmit - name: Test (domain) working-directory: plugin run: bun test - name: Build backend bundle + SPA working-directory: plugin run: bun run build:all - name: Typecheck (UI) working-directory: ui run: bunx tsc --noEmit - name: Sanity — plugin default export is a valid PluginDef working-directory: plugin run: | bun -e 'import plugin from "./dist/index.js"; if (plugin?.name !== "playnite" || typeof plugin?.main !== "function") { console.error("bad default export", plugin); process.exit(1); } console.log("ok:", plugin.name)' - name: Sanity — no fixtures in the production SPA bundle working-directory: plugin run: | for needle in placehold.co mockHttpClientLayer tickerFrames; do if grep -rq "$needle" dist/ui/assets/*.js; then echo "fixture string '$needle' leaked into the production bundle"; exit 1 fi done echo "ok: production bundle is fixture-free" exporter: runs-on: ubuntu-24.04 container: image: mcr.microsoft.com/dotnet/sdk:8.0 timeout-minutes: 15 steps: # The SDK image is Debian but ships neither git (for checkout) nor zip (for packaging). - name: Install git + zip run: apt-get update && apt-get install -y --no-install-recommends git zip ca-certificates nodejs - uses: actions/checkout@v4 - name: Build exporter (net462) run: dotnet build exporter/PunktfunkSync.csproj -c Release - name: Package .pext run: | mkdir -p "$GITHUB_WORKSPACE/out" cd exporter/bin/Release zip -j -X "$GITHUB_WORKSPACE/out/punktfunk-sync.pext" extension.yaml PunktfunkSync.dll ls -l "$GITHUB_WORKSPACE/out/punktfunk-sync.pext" # v3: Gitea's API rejects upload-artifact@v4. - name: Upload .pext uses: actions/upload-artifact@v3 with: name: punktfunk-sync-pext path: out/punktfunk-sync.pext publish: needs: [build, exporter] if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-24.04 container: image: oven/bun:1 timeout-minutes: 15 steps: - name: Install git + CA certs run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git nodejs - uses: actions/checkout@v4 - name: Registry auth env: TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | test -n "$TOKEN" || { echo "REGISTRY_TOKEN secret is empty"; exit 1; } printf '//git.unom.io/api/packages/unom/npm/:_authToken=%s\n' "$TOKEN" > "$HOME/.npmrc" - name: Install (workspace) run: bun install --frozen-lockfile - name: Tag matches package version working-directory: plugin run: | TAG="${GITHUB_REF_NAME#v}" PKG="$(node -p "require('./package.json').version")" test "$TAG" = "$PKG" || { echo "tag $GITHUB_REF_NAME != package version $PKG"; exit 1; } - name: Publish (prepublishOnly builds backend + SPA) working-directory: plugin run: bun publish