ci: 修两处 Gitea 上跑不了的东西(upload-artifact v4 → v3、去掉缓存)
第一次真实运行的日志(job 14)钉出来的两件事:
1. 上传产物那一步一直是失败的:
GHESNotSupportedError: @actions/artifact v2.0.0+, upload-artifact@v4+
and download-artifact@v4+ are not currently supported on GHES
v4 里的 @actions/artifact 会拒绝非 github.com 的服务器。Gitea 实现的是 v3 那套
接口(ACTIONS_RUNTIME_URL),所以三个平台都换成 upload-artifact@v3,并加一个
.github/actionlint.yaml 把"v3 太旧"这条 GitHub 规则的误报关掉(原因写在里面)。
产物路径本身没问题:日志里 tauri build 已经产出 deb/AppImage,v4 在报错之前也
认出了那批文件("The least common ancestor is .../release/bundle")。
2. 缓存服务在 job 容器里连不上:
Failed to restore: getCacheEntry failed: connect ETIMEDOUT 172.18.0.2:37315
setup-node 的 cache: pnpm 每次要干等 4 分 39 秒才放弃,cargo 缓存那步也白等 26 秒。
先全部去掉(两个 job 每轮省约 10 分钟),文件头第 3 条写明了等缓存修好怎么加回来。
其余在真机上都是绿的:rustup 兜底、pnpm 12.11.2、Node 24.22.0、tsc、vite、
protocol 15 / cam-core 80 / src-tauri 30 个测试、tauri build(deb + AppImage)全过。
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
# actionlint 配置。
|
||||||
|
#
|
||||||
|
# 这个仓库的 CI 跑在 Gitea 上,但 actionlint 用的是 GitHub 的规则,所以有一条
|
||||||
|
# 政策性的误报要忽略掉:
|
||||||
|
#
|
||||||
|
# the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions
|
||||||
|
#
|
||||||
|
# 它对 GitHub 是成立的(v3 声明的 node16 运行时 GitHub 已经不再执行),但我们是
|
||||||
|
# Gitea:Gitea 的 runner 用自己的 node 跑 JS action,v3 能正常把产物传上去;反过来
|
||||||
|
# v4 在 Gitea 上**根本跑不了** —— v4 里的 @actions/artifact 会拒绝非 github.com
|
||||||
|
# 的服务器(GHESNotSupportedError,原文见 .github/workflows/build-client.yml 文件头
|
||||||
|
# 第 3 条,那是 2026-10-15 第一次真实运行的日志里抄下来的)。
|
||||||
|
paths:
|
||||||
|
.github/workflows/*.yml:
|
||||||
|
ignore:
|
||||||
|
- 'the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions'
|
||||||
@@ -37,6 +37,27 @@
|
|||||||
# 2. 这个文件放在 .github/workflows/ 下就够:Gitea 的 [actions] WORKFLOW_DIRS
|
# 2. 这个文件放在 .github/workflows/ 下就够:Gitea 的 [actions] WORKFLOW_DIRS
|
||||||
# 默认值就是 [".gitea/workflows", ".github/workflows"](源码里的默认值,且
|
# 默认值就是 [".gitea/workflows", ".github/workflows"](源码里的默认值,且
|
||||||
# .yml 与 .yaml 都认),所以两个目录都是原生支持的,不用挪。
|
# .yml 与 .yaml 都认),所以两个目录都是原生支持的,不用挪。
|
||||||
|
# 3. 两处"GitHub 能跑、Gitea 上不行"的地方,都是 2026-10-15 第一次真实运行的
|
||||||
|
# 日志里钉出来的:
|
||||||
|
# * 传产物用 upload-artifact@v3,**不能用 v4**。v4 里的 @actions/artifact 会
|
||||||
|
# 拒绝非 github.com 的服务器,日志原文:
|
||||||
|
# GHESNotSupportedError: @actions/artifact v2.0.0+, upload-artifact@v4+
|
||||||
|
# and download-artifact@v4+ are not currently supported on GHES
|
||||||
|
# Gitea 实现的是 v3 那套接口(ACTIONS_RUNTIME_URL),所以 v3 能传上去。
|
||||||
|
# * 一个缓存都没开。这台实例的缓存服务在 job 容器里连不上,日志原文:
|
||||||
|
# Failed to restore: getCacheEntry failed: connect ETIMEDOUT 172.18.0.2:37315
|
||||||
|
# setup-node 的 cache 每次要干等 4 分 39 秒才放弃(两个 job 各一次)。
|
||||||
|
# 等缓存能从容器访问到了再加回来,写法就是:
|
||||||
|
# setup-node 的 with 里加:cache: pnpm / cache-dependency-path: desktop/pnpm-lock.yaml
|
||||||
|
# 各 job 里加:
|
||||||
|
# - uses: actions/cache@v4
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ~/.cargo/registry/index
|
||||||
|
# ~/.cargo/registry/cache
|
||||||
|
# ~/.cargo/git/db
|
||||||
|
# key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
||||||
|
# restore-keys: ${{ runner.os }}-cargo-registry-
|
||||||
#
|
#
|
||||||
# ── 三个平台都显式写 --target,这不是啰嗦 ────────────────────────────────────
|
# ── 三个平台都显式写 --target,这不是啰嗦 ────────────────────────────────────
|
||||||
# desktop/.cargo/config.toml 里钉着 `target = "aarch64-apple-darwin"`(本机开发用;
|
# desktop/.cargo/config.toml 里钉着 `target = "aarch64-apple-darwin"`(本机开发用;
|
||||||
@@ -148,7 +169,8 @@ jobs:
|
|||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pnpm 必须在 setup-node 之前:setup-node 的 cache: pnpm 要用它算 store 路径。
|
# pnpm 装在 setup-node 之前:这一步只靠 runner 镜像里自带的 node(实测
|
||||||
|
# /opt/hostedtoolcache 里有 24.x),而下面的 pnpm install 要用它。
|
||||||
- name: 装 pnpm
|
- name: 装 pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
@@ -158,8 +180,6 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
||||||
|
|
||||||
- name: 前端依赖(严格按 lock 装)
|
- name: 前端依赖(严格按 lock 装)
|
||||||
working-directory: desktop
|
working-directory: desktop
|
||||||
@@ -178,21 +198,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
targets: x86_64-unknown-linux-gnu
|
targets: x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
# 只缓存 registry(crate 源码),不缓存 target/:自建 runner 的容器每次都是
|
|
||||||
# 干净的,几 GB 的 target 缓存拉下来的时间常常比重新编译还长,磁盘也扛不住。
|
|
||||||
# 缓存服务在不同 Gitea 版本上差异较大,所以失败不让它拖垮构建。
|
|
||||||
- name: cargo 缓存
|
|
||||||
uses: actions/cache@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/index
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/git/db
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-registry-
|
|
||||||
|
|
||||||
# protocol 没有自己的 rust-toolchain.toml,会被根目录那个 `esp` 接住,
|
# protocol 没有自己的 rust-toolchain.toml,会被根目录那个 `esp` 接住,
|
||||||
# 所以这里必须 +stable 显式指定。
|
# 所以这里必须 +stable 显式指定。
|
||||||
- name: protocol 单元测试(15)
|
- name: protocol 单元测试(15)
|
||||||
@@ -272,25 +277,11 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
||||||
|
|
||||||
- name: 前端依赖(严格按 lock 装)
|
- name: 前端依赖(严格按 lock 装)
|
||||||
working-directory: desktop
|
working-directory: desktop
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: cargo 缓存
|
|
||||||
uses: actions/cache@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/index
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/git/db
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-registry-
|
|
||||||
|
|
||||||
# 上面 apt 装了 ffmpeg,所以 recording.rs 里那几条"真的起 ffmpeg 并读回帧数"
|
# 上面 apt 装了 ffmpeg,所以 recording.rs 里那几条"真的起 ffmpeg 并读回帧数"
|
||||||
# 的测试不会走 has_ffmpeg() 的跳过分支,是真的在验。
|
# 的测试不会走 has_ffmpeg() 的跳过分支,是真的在验。
|
||||||
# 如果这台 runner 上它们长期不稳定,删掉这一步即可 —— 它们不在守门 job 里,
|
# 如果这台 runner 上它们长期不稳定,删掉这一步即可 —— 它们不在守门 job 里,
|
||||||
@@ -305,7 +296,7 @@ jobs:
|
|||||||
run: pnpm tauri build --target ${{ env.TARGET }} --bundles deb,appimage
|
run: pnpm tauri build --target ${{ env.TARGET }} --bundles deb,appimage
|
||||||
|
|
||||||
- name: 上传产物
|
- name: 上传产物
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cam-desktop-linux-x64
|
name: cam-desktop-linux-x64
|
||||||
# 一个都没找到就报错:产物路径写错却"构建成功"是最难发现的一种失败。
|
# 一个都没找到就报错:产物路径写错却"构建成功"是最难发现的一种失败。
|
||||||
@@ -353,25 +344,11 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
||||||
|
|
||||||
- name: 前端依赖(严格按 lock 装)
|
- name: 前端依赖(严格按 lock 装)
|
||||||
working-directory: desktop
|
working-directory: desktop
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: cargo 缓存
|
|
||||||
uses: actions/cache@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/index
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/git/db
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-registry-
|
|
||||||
|
|
||||||
# nsis 是纯安装包,不需要 WiX;tauri 会自己把 NSIS 下到用户缓存里,所以
|
# nsis 是纯安装包,不需要 WiX;tauri 会自己把 NSIS 下到用户缓存里,所以
|
||||||
# 这台 runner 要能访问 GitHub(离线环境改成 --bundles msi 也一样要下 WiX)。
|
# 这台 runner 要能访问 GitHub(离线环境改成 --bundles msi 也一样要下 WiX)。
|
||||||
- name: 打包(tauri build)
|
- name: 打包(tauri build)
|
||||||
@@ -379,7 +356,7 @@ jobs:
|
|||||||
run: pnpm tauri build --target ${{ env.TARGET }} --bundles nsis
|
run: pnpm tauri build --target ${{ env.TARGET }} --bundles nsis
|
||||||
|
|
||||||
- name: 上传产物
|
- name: 上传产物
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cam-desktop-windows-x64
|
name: cam-desktop-windows-x64
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -426,25 +403,11 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
cache: pnpm
|
|
||||||
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
||||||
|
|
||||||
- name: 前端依赖(严格按 lock 装)
|
- name: 前端依赖(严格按 lock 装)
|
||||||
working-directory: desktop
|
working-directory: desktop
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: cargo 缓存
|
|
||||||
uses: actions/cache@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry/index
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
~/.cargo/git/db
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-cargo-registry-
|
|
||||||
|
|
||||||
# 只想要当前架构、想省一半编译时间的话,把 --target 换成 aarch64-apple-darwin
|
# 只想要当前架构、想省一半编译时间的话,把 --target 换成 aarch64-apple-darwin
|
||||||
# (Apple Silicon 的 runner)并去掉上面 targets 里的 x86_64 即可。
|
# (Apple Silicon 的 runner)并去掉上面 targets 里的 x86_64 即可。
|
||||||
- name: 打包(tauri build)
|
- name: 打包(tauri build)
|
||||||
@@ -454,7 +417,7 @@ jobs:
|
|||||||
# 第二行是兜底:不同 tauri-cli 版本给通用包放的目录略有差异,宁可多写一行,
|
# 第二行是兜底:不同 tauri-cli 版本给通用包放的目录略有差异,宁可多写一行,
|
||||||
# 也不要上传时静默少东西。(注意 path 是块标量,里面写 # 是路径不是注释。)
|
# 也不要上传时静默少东西。(注意 path 是块标量,里面写 # 是路径不是注释。)
|
||||||
- name: 上传产物
|
- name: 上传产物
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cam-desktop-macos-universal
|
name: cam-desktop-macos-universal
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
Reference in New Issue
Block a user