Skip to content

feat(core): add scoped PluginFS for folder plugins (closes #141) #332

feat(core): add scoped PluginFS for folder plugins (closes #141)

feat(core): add scoped PluginFS for folder plugins (closes #141) #332

Workflow file for this run

name: build
on:
push:
branches:
- main
- dev
- release/*
- feat/app-hub
workflow_dispatch:
jobs:
build:
name: build-${{ matrix.platform }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- platform: windows
os: windows-2022
- platform: macos
os: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Prepare environment variables
run: |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "APP_VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
# ─── Toolchains (shared) ────────────────────────────────────────────
# .NET 10 SDK for both Pengu.Windows (AOT) and Pengu.MacOS (workload).
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: true
# ─── Toolchains (Windows) ───────────────────────────────────────────
# MSBuild + the VS 2022 C++ workload (preinstalled on windows-2022).
# PublishAot relies on the C++ toolchain shipped with the workload.
- name: Setup MSBuild
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
# ─── Toolchains (macOS) ─────────────────────────────────────────────
# Microsoft.macOS.Sdk.net10.0_26.4 requires Xcode 26.x. Select the
# latest stable Xcode on the runner; the workload install fails loudly
# if 26+ isn't available.
- name: Select latest Xcode
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install .NET macOS workload
if: runner.os == 'macOS'
run: sudo dotnet workload install macos
# ─── Build (shared) ─────────────────────────────────────────────────
# Preload bundle is #include'd into core (renderer.cc embeds preload.g.h).
# Build it before core so the header exists.
- name: Build preload
run: pnpm --filter @pengujs/preload build
# ─── Build (Windows) ────────────────────────────────────────────────
# C++ core -> core/bin/core.dll (the vcxproj writes there directly).
- name: Build core (windows)
if: runner.os == 'Windows'
run: msbuild.exe core/core.vcxproj -p:Configuration=Release -p:Platform=x64 -nologo -m
# AOT-publish the .NET 10 host. The csproj's BuildHubBundle target runs
# `pnpm --filter @pengujs/hub build` and zips packages/hub/dist/ into
# app.dat as part of the build, and the PublishAppDat target adds app.dat
# to ResolvedFileToPublish — so a single dotnet publish produces
# Pengu.exe + app.dat in the output dir.
- name: Publish app/Pengu.Windows (AOT)
if: runner.os == 'Windows'
run: |
dotnet publish app/Pengu.Windows \
-c Release \
-r win-x64 \
--output app-publish
# Clean portable payload: extract the artifact archive anywhere, run Pengu.exe.
# app.dat is embedded inside Pengu.exe via <EmbeddedResource> — no
# separate file ships alongside the exe.
- name: Stage portable payload (windows)
if: runner.os == 'Windows'
run: |
mkdir -p out/
cp app-publish/Pengu.exe out/
cp app-publish/WebView2Loader.dll out/
cp core/bin/core.dll out/
# ─── Build (macOS) ──────────────────────────────────────────────────
# C++ core -> core/bin/core.dylib (the makefile's LIB_OUT_PATH).
- name: Build core (macos)
if: runner.os == 'macOS'
run: make -C core -j release
# Publish the .NET 10 macOS host as AOT + universal (arm64 + x86_64).
# The csproj's <RuntimeIdentifiers> drives multi-arch — no -r flag.
# The macOS workload publishes each RID, lipo's the resulting native
# binaries, and stages the universal Pengu binary plus app.dat inside
# Pengu.app/Contents/{MacOS,Resources}/. Expect 30–60 minutes due to
# AOT compilation + per-RID lipo on a CI runner.
- name: Publish app/Pengu.MacOS (AOT, universal)
if: runner.os == 'macOS'
run: |
dotnet publish app/Pengu.MacOS \
-c Release \
--output app-publish
# Stage two deliverables for the macOS artifact:
# - Pengu-<ver>.pkg — installer with the universal AOT app inside
# - Pengu.app — universal AOT build (x86_64 + arm64, ~28 MB),
# drag-to-Applications form
#
# The .pkg lands in --output (app-publish/). The universal .app
# always lands at bin/Release/net10.0-macos/Pengu.app regardless of
# --output — `--output` only stages the .pkg installer, not the
# bundle. The bin/.../Pengu.app already has full <BundleResource>
# staging (app-icon.icns, core.dylib), lipo'd Mach-O, and the
# workload's codesign applied. The per-RID .apps under
# bin/Release/.../{osx-arm64,osx-x64}/ are intermediate skeletons —
# not used for distribution.
- name: Stage macOS deliverables
if: runner.os == 'macOS'
run: |
mkdir -p out/
cp app-publish/*.pkg out/
cp -R app/Pengu.MacOS/bin/Release/net10.0-macos/Pengu.app out/Pengu.app
codesign --verify --verbose=2 out/Pengu.app
# ─── Artifact upload (shared) ───────────────────────────────────────
- name: Upload portable artifact
uses: actions/upload-artifact@v4
with:
name: pengu-v${{ env.APP_VERSION }}-${{ env.SHORT_SHA }}-${{ matrix.platform }}
path: out/
if-no-files-found: error
compression-level: 9