发布链路:tag 触发 CI 发 Release,install.sh 负责安装
release / release (push) Failing after 1m11s

产物是架构无关的 JS tarball(约 400 KB)而不是 bun 单文件:
单文件 94 MB 里几乎全是运行时,静态文件还得外置。架构差异
由安装侧的 bun 运行时吸收,版本钉死,和 CI 构建版本一起改。
This commit is contained in:
2026-08-12 15:38:55 +08:00
parent 27ebdac034
commit 944da9fee4
2 changed files with 438 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
# 发布流程:推送 v* 标签 → 测试 → 构建 → 把产物挂到 Gitea Release 上。
#
# 产物 patchbay.tar.gz 与 CPU 架构无关(纯 JS + 静态文件),
# 架构差异由目标机器上的 bun 运行时吸收,安装侧见仓库根目录的 install.sh。
name: release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 构建用的 bun 版本和 install.sh 里的 BUN_VERSION 保持一致,升级时两处一起改
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- run: bun install --frozen-lockfile
- run: bun test
- run: bun run typecheck
# 布局必须保持 server/ 与 web-dist/ 平级:
# server/routes.ts 里 WEB_DIST 用 import.meta.url 相对定位 ../web-dist/
- name: 构建并打包
run: |
bun run build
bun build --target=bun --minify server/index.ts --outfile dist/patchbay/server/index.js
cp -r web-dist dist/patchbay/web-dist
echo "${GITHUB_REF_NAME}" > dist/patchbay/version.txt
cp dist/patchbay/version.txt version.txt
tar -czf patchbay.tar.gz -C dist patchbay
# version.txt 单独作为 asset 再传一份,install.sh check 用它比对版本,
# 不用把整个 tarball 拉下来
- name: 发布 Release
uses: https://gitea.com/actions/release-action@main
with:
# 默认令牌建不了 Release 时(老版本 Gitea 的权限限制),
# 在仓库 Settings → Actions → Secrets 里加一个 RELEASE_TOKEN
api_key: '${{ secrets.RELEASE_TOKEN || github.token }}'
files: |-
patchbay.tar.gz
version.txt