Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
# **只在 dev 上存。**一个 PR 读得到的缓存只有三处:它自己的、目标分支(dev)
# 的、默认分支(main)的,读不到别的 PR 存的。PR 上存的那份只有同一个 PR
# 再推一次才用得上,却一样大,挤占仓库 10 GB 的缓存额度、把 dev 的挤掉。
# main 只是快进,它的推送和 dev 上同一笔一样,存了也没人读
save-if: ${{ github.ref == 'refs/heads/dev' }}
# **一个只检查代码的任务为什么要下载一个发布产物。**
#
# `tauri.conf.json` 声明 `.app` 里装着 twcore,而 Tauri 的
Expand Down Expand Up @@ -125,8 +130,10 @@ jobs:
workspaces: src-tauri
# **失败也存。**这个 action 默认只在任务成功时保存缓存,而一个刚
# 立起来、还在逐条修的任务恰恰一次都不会成功 —— 于是「红 → 不存
# 缓存 → 从零编译 → 还是红」自己维持住了。
# 缓存 → 从零编译 → 还是红」自己维持住了。PR 上不存(见 macOS 那一档),
# 所以这条只对 dev 起作用
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/dev' }}

# 理由同 macOS 那一档:`tauri.conf.json` 声明包里装着 twcore,而 Tauri
# 的 build script 在**编译期**就校验那个文件在不在。
Expand Down Expand Up @@ -227,6 +234,8 @@ jobs:
with:
workspaces: src-tauri
cache-on-failure: true
# 见 macOS 那一档
save-if: ${{ github.ref == 'refs/heads/dev' }}

# 理由同 macOS 那一档:`tauri.conf.json` 声明包里装着 twcore,而 Tauri
# 的 build script 在**编译期**就校验那个文件在不在;接缝测试还要真的
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
# **tag 上只读不存。**tag 上的运行读得到的缓存只有这个 tag 自己的和默认
# 分支(main)的;挂在 tag 名下的缓存下一个 tag 读不到,白占仓库 10 GB 的
# 缓存额度(v2026.10.7 一次占了 3.3 GB),还把 dev 上 CI 天天在用的挤掉。
# 演练分支照存:同一个演练分支常要连推几轮,后面几轮用得上
save-if: ${{ !startsWith(github.ref, 'refs/tags/') }}

- run: pnpm install --frozen-lockfile

Expand Down Expand Up @@ -294,6 +299,8 @@ jobs:
with:
workspaces: src-tauri
key: ${{ matrix.target }}
# 见 macOS 那一档
save-if: ${{ !startsWith(github.ref, 'refs/tags/') }}

# 取版本号、取 twcore 的两个脚本要 Python。Windows 的机器上不一定有,
# 有也不一定叫 `python3` —— 脚本两个名字都认,这里保证至少有一个
Expand Down Expand Up @@ -603,6 +610,8 @@ jobs:
with:
workspaces: src-tauri
key: ${{ matrix.target }}
# 见 macOS 那一档
save-if: ${{ !startsWith(github.ref, 'refs/tags/') }}

- run: pnpm install --frozen-lockfile

Expand Down
Loading