airi/.github/workflows/ci.yml
Lilia_Chen c6c0494998
feat(stage-tamagotchi-godot): add Godot stage G0 sidecar preview (#1724)
## Summary

Add the G0 Godot Stage sidecar preview for `stage-tamagotchi`.

## Design

- Keep Electron as the desktop host and run Godot as a separate sidecar
window by design.
- Use the settings window as the entry point for starting/stopping the
experimental Godot Stage.
- Require explicit `GODOT4` in development mode instead of
auto-discovering local Godot installs.
- Use the packaged sidecar under `process.resourcesPath/godot-stage` in
the packaged runtime.
- Close the Godot WebSocket lifecycle channel on startup failure and
stage shutdown.

## Changes

- Add the Electron main-side Godot Stage lifecycle service.
- Add renderer/settings wiring for switching to the experimental Godot
Stage.
- Add the minimal Godot stage runtime skeleton and WebSocket handshake
path.
- Add Godot export presets for sidecar builds.
- Add sidecar path verification for the Godot export preset and
`electron-builder` resource contract.
- Document the development runtime setup and packaging expectations.

## CI/CD

- Align Godot CI to `4.6.2`.
- Add Linux Godot export smoke coverage as the fastest CI export path.
- Add sidecar contract verification to CI.
- Run packaged sidecar verification after `electron-builder --dir`.

CD is intentionally deferred in this PR. The release workflow still
needs a later step to export the Godot sidecar before packaging release
artefacts.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-25 00:56:03 +08:00

144 lines
4.3 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
# Setup .NET for Godot C# linting
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
# Lint Godot C# code
- name: Lint Godot C#
working-directory: ./engines/stage-tamagotchi-godot
run: dotnet format stage-tamagotchi-godot.sln --verify-no-changes
- run: docker run -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
working-directory: ./apps/stage-pocket
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: docker run -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
working-directory: ./apps/stage-pocket
build-test:
name: Build Test (${{ matrix.app_name }})
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.label, 'moeru-ai:i18n/')) }}
strategy:
matrix:
include:
- app_name: stage-web
command: pnpm -F @proj-airi/stage-web run build && pnpm -F @proj-airi/docs run build:base && mv ./docs/.vitepress/dist ./apps/stage-web/dist/docs && pnpm -F @proj-airi/stage-ui run story:build && mv ./packages/stage-ui/.histoire/dist ./apps/stage-web/dist/ui
- app_name: stage-tamagotchi
command: pnpm -F @proj-airi/stage-tamagotchi run build
- app_name: stage-tamagotchi-godot
command: cd engines/stage-tamagotchi-godot && dotnet restore && dotnet build -c ExportRelease
- app_name: ui-transitions
command: pnpm -F @proj-airi/ui-transitions run play:build
- app_name: ui-loading-screens
command: pnpm -F @proj-airi/ui-loading-screens run play:build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Turborepo
- name: Cache turbo build setup
uses: actions/cache@v5
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
# Setup .NET and Godot
- name: Setup .NET
if: matrix.app_name == 'stage-tamagotchi-godot'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup Godot
if: matrix.app_name == 'stage-tamagotchi-godot'
uses: chickensoft-games/setup-godot@v2
with:
version: 4.6.2
use-dotnet: true
include-templates: true
- run: pnpm install --frozen-lockfile
- run: pnpm run build:packages
- name: Build App
run: ${{ matrix.command }}
- name: Export Godot Linux sidecar
if: matrix.app_name == 'stage-tamagotchi-godot'
working-directory: ./engines/stage-tamagotchi-godot
run: |
mkdir -p build/linux
godot --headless --export-release "Linux" build/linux/godot-stage
typecheck:
name: Type Check
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.label, 'moeru-ai:i18n/')) }}
steps:
- uses: actions/checkout@v6
# Node.js
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run typecheck
check-provenance:
name: Check Provenance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: danielroe/provenance-action@main
id: check
with:
fail-on-provenance-change: true # optional, default: false
# lockfile: pnpm-lock.yaml # optional
# base-ref: origin/main # optional, default: origin/main
# fail-on-downgrade: true # optional, default: true
- name: Print result
run: "echo 'Downgraded: ${{ steps.check.outputs.downgraded }}'"