jim800121chen c54f16fca0 Initial commit: visionA monorepo with local-tool subproject
local-tool/: visionA-local desktop app
- M1: Wails shell + Go server + Next.js UI + Mock mode (macOS dmg ready)
- M2: i18n (zh-TW/en) + Settings 4-tab refactor
- M3: Embedded Python 3.12 runtime (python-build-standalone) + KneronPLUS wheels
- M4: Windows Inno Setup script (build on Windows runner)
- M5: Linux AppImage script + udev rule (build on Linux runner)
- M6: ffmpeg (GPL, pending legal review) + yt-dlp bundled
- Lifecycle: watchServer health check, fatal native dialog,
            Wails IPC raise endpoint, stale process cleanup

.autoflow/: full PRD / Design Spec / Architecture / Testing docs
            (4 rounds tri-party discussion + cross review)
.github/workflows/: macOS / Windows / Linux build CI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:10:38 +08:00

264 lines
8.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
env:
GO_VERSION: '1.26'
NODE_VERSION: '22'
PNPM_VERSION: '9'
# 暫時允許 GPL ffmpeg build 通過 vendor-sync 的授權檢查。
# 發佈前若 ffmpeg 來源改為 LGPL請移除此變數。
VISIONA_ALLOW_GPL_FFMPEG: '1'
jobs:
# ────────────────────────────────────────────────────────────────
# macOS (Intel / x86_64)
# 使用 macos-13目前最後的 Intel Mac runner避免 macos-latest 被
# 切到 Apple Silicon 後產出 ARM binary。
# ────────────────────────────────────────────────────────────────
build-macos:
name: Build macOS (x86_64)
runs-on: macos-13
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Cache vendor/
uses: actions/cache@v4
with:
path: vendor/
key: vendor-darwin-${{ hashFiles('Makefile') }}-${{ hashFiles('visiona-local/wheels/macos/**') }}
restore-keys: |
vendor-darwin-${{ hashFiles('Makefile') }}-
vendor-darwin-
- name: vendor-sync (macOS deps)
run: make vendor-sync
- name: Build .dmg
run: make dmg
- name: Verify .dmg
run: |
ls -lh dist/visiona-local.dmg
file dist/visiona-local.dmg
hdiutil imageinfo dist/visiona-local.dmg | head -20
- name: Upload .dmg artifact
uses: actions/upload-artifact@v4
with:
name: visiona-local-macos-x64
path: dist/visiona-local.dmg
retention-days: 30
if-no-files-found: error
# ────────────────────────────────────────────────────────────────
# Windows (x86_64)
# 使用 windows-2022。vendor-sync 的 macOS/Linux 部分會失敗,
# 因此只跑 *-windows 的 vendor targets。
# ────────────────────────────────────────────────────────────────
build-windows:
name: Build Windows (x86_64)
runs-on: windows-2022
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Install Inno Setup
run: choco install innosetup -y --no-progress
shell: pwsh
- name: Add Inno Setup to PATH
run: echo "/c/Program Files (x86)/Inno Setup 6" >> "$GITHUB_PATH"
- name: Cache vendor/
uses: actions/cache@v4
with:
path: vendor/
key: vendor-windows-${{ hashFiles('Makefile') }}-${{ hashFiles('visiona-local/wheels/windows/**') }}
restore-keys: |
vendor-windows-${{ hashFiles('Makefile') }}-
vendor-windows-
- name: vendor-sync (Windows-only deps)
run: |
make vendor-python-windows \
vendor-wheels-windows \
vendor-ffmpeg-windows \
vendor-ytdlp-windows
- name: Build server.exe
env:
GOOS: windows
GOARCH: amd64
run: |
mkdir -p payload/windows/bin
cd server
go build -o ../payload/windows/bin/visiona-local-server.exe .
ls -lh ../payload/windows/bin/visiona-local-server.exe
- name: Build frontend (for go:embed)
run: make build-embed
- name: Build .exe installer
run: make exe
- name: Verify .exe
run: |
ls -lh dist/visiona-local-*.exe || ls -lh dist/*.exe
file dist/visiona-local-*.exe 2>/dev/null || true
- name: Upload .exe artifact
uses: actions/upload-artifact@v4
with:
name: visiona-local-windows-x64
path: dist/visiona-local-*.exe
retention-days: 30
if-no-files-found: error
# ────────────────────────────────────────────────────────────────
# Linux (x86_64)
# 使用 ubuntu-22.04glibc 2.35,相容性比 24.04 更好)。
# ────────────────────────────────────────────────────────────────
build-linux:
name: Build Linux (x86_64)
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libusb-1.0-0-dev \
fuse \
libfuse2 \
desktop-file-utils
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Install appimagetool
run: |
curl -fL -o /tmp/appimagetool \
"https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage"
chmod +x /tmp/appimagetool
sudo mv /tmp/appimagetool /usr/local/bin/appimagetool
appimagetool --version || true
- name: Cache vendor/
uses: actions/cache@v4
with:
path: vendor/
key: vendor-linux-${{ hashFiles('Makefile') }}-${{ hashFiles('visiona-local/wheels/linux/**') }}
restore-keys: |
vendor-linux-${{ hashFiles('Makefile') }}-
vendor-linux-
- name: vendor-sync (Linux-only deps)
run: |
make vendor-python-linux \
vendor-wheels-linux \
vendor-ffmpeg-linux \
vendor-ytdlp-linux
- name: Build server (Linux)
run: |
mkdir -p payload/linux/bin
cd server
GOOS=linux GOARCH=amd64 go build -o ../payload/linux/bin/visiona-local-server .
ls -lh ../payload/linux/bin/visiona-local-server
- name: Build frontend (for go:embed)
run: make build-embed
- name: Build AppImage
run: make appimage
- name: Verify AppImage
run: |
ls -lh dist/visiona-local-*.AppImage
file dist/visiona-local-*.AppImage
- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: visiona-local-linux-x64
path: dist/visiona-local-*.AppImage
retention-days: 30
if-no-files-found: error