mirror of
https://github.com/YuleBest/LuminPro.git
synced 2026-12-04 00:54:42 +08:00
- 删除 rust/、script/up.sh、script/daemon.sh、bin/jq(ZIP 少 1.8MB 依赖) - service.sh 改为薄启动器;boost.sh / script/restart.sh 转发到 Go 子命令 - customize.sh 全部 jq 调用改为 luminpro config(init/ensure/set/get/summary/ inspect/migrate),安装向导与旧配置迁移逻辑保持不变 - CI 去掉 Rust 工具链与 NDK,改为 setup-go + go vet/test + 交叉编译 - build-module.js 排除 go/ dist/ .zcode/;.gitignore 忽略 bin/luminpro - WebUI 清理 up.flag 死引用,状态页标签改为「守护进程」 - README / README_en / DEVELOPMENT 同步为 Go 架构说明
77 lines
2.7 KiB
YAML
77 lines
2.7 KiB
YAML
name: Build & Package Module
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# ── 1. WebUI ────────────────────────────────────────────────────────
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: Install Node.js dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build WebUI
|
|
run: pnpm build
|
|
|
|
# ── 2. luminpro 二进制 (Go) ─────────────────────────────────────────
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go/go.mod
|
|
cache-dependency-path: go/go.sum
|
|
|
|
- name: Test Go packages
|
|
working-directory: go
|
|
run: |
|
|
go vet ./...
|
|
go test ./...
|
|
|
|
- name: Build luminpro (android/arm64)
|
|
working-directory: go
|
|
run: |
|
|
mkdir -p ../bin
|
|
CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ../bin/luminpro ./cmd/luminpro
|
|
chmod +x ../bin/luminpro
|
|
|
|
# ── 3. 打包模块 ──────────────────────────────────────────────────────
|
|
- name: Package module
|
|
run: node build-module.js
|
|
|
|
# ── 4. 重命名 zip 加入 commit 短哈希 ─────────────────────────────────
|
|
- name: Rename zip with commit hash
|
|
id: names
|
|
run: |
|
|
VERSION=$(grep '^version=' module.prop | cut -d= -f2 | tr -d '[:space:]')
|
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
|
FINAL="LuminPro_${VERSION}-${SHORT_SHA}.zip"
|
|
mv "LuminPro_${VERSION}.zip" "$FINAL"
|
|
echo "zip=$FINAL" >> "$GITHUB_OUTPUT"
|
|
|
|
# ── 5. 上传 artifact(单个 zip 文件) ────────────────────────────────
|
|
# upload-artifact 上传单个文件时仍会套一层 zip;通过 gh run download 下载
|
|
# 后得到的即是模块 zip,直接可刷入,无需二次解压。
|
|
- name: Upload module zip
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ steps.names.outputs.zip }}
|
|
path: ${{ steps.names.outputs.zip }}
|
|
if-no-files-found: error
|