26 包 monorepo(TS 全源码): - snowcat-core: NT 内核 API 封装 + listener(含 9.9.37 六回调适配)+ Packet 发包 - snowcat-onebot: OneBot v11 全动作 + MCP Streamable HTTP 适配器 + 稳定线 - snowcat-webui-frontend/backend: 雪猫控制台(React+HeroUI) - snowcat-shell: 单文件 bundle 出口(vite inlineDynamicImports) - snowcat-native: napi2native / MoeHoo / ffmpeg / pty 运行时 - 56 项 SnowLuma 独门动作移植(qzone 全家桶/群相册/装扮/闪照/收藏) - 工具件: 解包器/启动器/便携制作器/doctor GitHub 关联已全量指向 DandanLLab/SnowCatQQ
92 lines
2.7 KiB
YAML
92 lines
2.7 KiB
YAML
name: Build NapCat Artifacts
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions: write-all
|
|
|
|
jobs:
|
|
typecheck-and-test:
|
|
name: Type Check & Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone Main Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
- name: Use Node.js 20.x
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20.x
|
|
- name: Install Dependencies
|
|
run: pnpm i
|
|
- name: Type Check
|
|
run: pnpm run typecheck
|
|
- name: Run Tests
|
|
run: pnpm test
|
|
|
|
build:
|
|
name: Build NapCat.${{ matrix.target.name }}
|
|
needs: typecheck-and-test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- name: Framework
|
|
build_cmd: build:framework
|
|
src_dir: packages/napcat-framework/dist
|
|
dist_dir: framework-dist
|
|
- name: Shell
|
|
build_cmd: build:shell
|
|
src_dir: packages/napcat-shell/dist
|
|
dist_dir: shell-dist
|
|
steps:
|
|
- name: Clone Main Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
- name: Use Node.js 20.x
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20.x
|
|
- name: Generate Version
|
|
run: |
|
|
LATEST_TAG=$(git describe --tags --abbrev=0 --match "v[0-9]*.[0-9]*.[0-9]*" 2>/dev/null || echo "v0.0.0")
|
|
BASE_VERSION="${LATEST_TAG#v}"
|
|
SHORT_SHA="${GITHUB_SHA::7}"
|
|
VERSION="${BASE_VERSION}-main.${{ github.run_number }}+${SHORT_SHA}"
|
|
echo "NAPCAT_VERSION=${VERSION}" >> $GITHUB_ENV
|
|
echo "Latest tag: ${LATEST_TAG}"
|
|
echo "Build version: ${VERSION}"
|
|
- name: Build NapCat.${{ matrix.target.name }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NAPCAT_VERSION: ${{ env.NAPCAT_VERSION }}
|
|
run: |
|
|
pnpm i
|
|
pnpm --filter napcat-webui-frontend run build || exit 1
|
|
pnpm run ${{ matrix.target.build_cmd }}
|
|
pnpm --filter napcat-plugin-builtin run build || exit 1
|
|
mv ${{ matrix.target.src_dir }} ${{ matrix.target.dist_dir }}
|
|
cd ${{ matrix.target.dist_dir }}
|
|
npm install --omit=dev
|
|
rm ./package-lock.json || exit 0
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: NapCat.${{ matrix.target.name }}
|
|
path: ${{ matrix.target.dist_dir }}
|