Skip to content

Commit 55f41ed

Browse files
committed
refactor(stash): move templates to dedicated repository
1 parent 67dd84f commit 55f41ed

16 files changed

Lines changed: 24 additions & 1014 deletions

.github/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| 文件名 | 描述 | 触发条件 |
1010
| :--- | :--- | :--- |
1111
| [`auto-backup-wiki.yml`](auto-backup-wiki.yml) | 校验 Wiki 目录页和页面完整性后,事务式备份到仓库的 `wiki/` 目录并处理链接替换 | 每 2 小时或手动触发 |
12-
| [`auto-generate-rules.yml`](auto-generate-rules.yml) |`.list` 规则源统一生成 `.yaml``.mrs` 派生规则,并由受维护的 Clash 模板同步生成 Mainland 与 Stash 兼容文件;完成精确 SHA 校验后调用统一 CDN 发布器 | 对应规则源、模板或生成器变更,源更新工作流同步调用,或手动触发 |
12+
| [`auto-generate-rules.yml`](auto-generate-rules.yml) |`.list` 规则源统一生成 `.yaml``.mrs` 派生规则,同步 Mainland 兼容文件,并将最终源提交发送给 `Custom_Stash_Rules` 生成 Stash 模板;完成精确 SHA 校验后调用统一 CDN 发布器 | 对应规则源、模板或生成器变更,源更新工作流同步调用,或手动触发 |
1313
| [`auto-update-encrypted-dns.yml`](auto-update-encrypted-dns.yml) | 从 HaGeZi、DNSCrypt 和编译后的 `geosite:category-doh` 自动更新 `Encrypted_DNS.list`;内容变化后同步等待派生规则生成,派生失败会使本工作流失败 | 每日或手动触发 |
1414
| [`auto-update-game-cdn.yml`](auto-update-game-cdn.yml) | 合并 v2fly 上游与本项目 `Steam_CDN.list`,智能去重后更新 `Game_Download_CDN.list`;内容变化后同步等待派生规则生成 | `Steam_CDN.list` 或生成器变更、每日或手动触发 |
1515
| [`codeql.yml`](codeql.yml) | 使用扩展安全与质量查询分析 GitHub Actions 和 Python | 相关代码推送、Pull Request、每日或手动触发 |
@@ -21,6 +21,6 @@
2121

2222
## Cloudflare 热备发布
2323

24-
`purge-jsdelivr.yml` 是 jsDelivr 与 Cloudflare 热备的统一发布边界。发布器只从指定 Git 提交读取公开文件,不复制工作区内容。涉及规则来源或生成器的提交必须先完成 YAML、MRS 和 Stash 模板生成;未完成时,发布器跳过整份 Static Assets 快照,等待生成工作流携带最终提交再次调用。
24+
`purge-jsdelivr.yml` 是 jsDelivr 与 Cloudflare 热备的统一发布边界。发布器只从指定 Git 提交读取公开文件,不复制工作区内容。涉及规则来源或生成器的提交必须先完成 YAML、MRS 和 Mainland 兼容文件生成;未完成时,发布器跳过整份 Static Assets 快照,等待生成工作流携带最终提交再次调用。Stash 模板由 `Custom_Stash_Rules` 独立校验和发布
2525

2626
Cloudflare 部署使用加密的 GitHub Secret。直接发布使用 Environment `cloudflare-production`;自动更新器经过多层可复用工作流时,通过同名 Repository Secret 和显式 `secrets: inherit` 逐层传递。仓库文件不保存 Cloudflare 账号 ID、区域 ID、部署令牌或运行时重定向令牌。发布任务通过 `--secrets-file` 将区域 ID 和运行时令牌写入 Cloudflare Worker Secret;运行时令牌限制为 `asailor.org` 的 Single Redirects 权限,并与部署令牌分离。

.github/workflows/auto-generate-rules.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ jobs:
8686
- name: Set up pinned Mihomo
8787
uses: ./.github/actions/setup-mihomo
8888

89-
- name: Generate derived rules and Stash templates
89+
- name: Generate derived rules and Mainland compatibility template
9090
run: |
9191
python py/generate_rules.py --mihomo mihomo
92-
python py/generate_stash_configs.py
92+
python py/generate_stash_configs.py --target mainland
9393
9494
- name: Test generation and conversion logic
9595
run: |
9696
python py/generate_rules.py --check --mihomo mihomo
97-
python py/generate_stash_configs.py --check
97+
python py/generate_stash_configs.py --check --target mainland
9898
9999
- name: Commit and push changes
100100
id: publish
@@ -110,15 +110,13 @@ jobs:
110110
':(glob)rule/game_rule/**/*.yaml'
111111
':(glob)rule/game_rule/**/*.mrs'
112112
'cfg/Custom_Clash_Mainland.ini'
113-
':(glob)cfg/Custom_Stash*.ini'
114113
)
115114
generated_excludes=(
116115
':(exclude,glob)rule/*.yaml'
117116
':(exclude,glob)rule/*.mrs'
118117
':(exclude,glob)rule/game_rule/**/*.yaml'
119118
':(exclude,glob)rule/game_rule/**/*.mrs'
120119
':(exclude)cfg/Custom_Clash_Mainland.ini'
121-
':(exclude,glob)cfg/Custom_Stash*.ini'
122120
)
123121
remote_main_sha() {
124122
git ls-remote --exit-code origin refs/heads/main |
@@ -132,8 +130,8 @@ jobs:
132130
git reset --hard origin/main
133131
python py/generate_rules.py --mihomo mihomo
134132
python py/generate_rules.py --check --mihomo mihomo
135-
python py/generate_stash_configs.py
136-
python py/generate_stash_configs.py --check
133+
python py/generate_stash_configs.py --target mainland
134+
python py/generate_stash_configs.py --check --target mainland
137135
138136
unexpected_changes="$(
139137
git status --short --untracked-files=all -- . \

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
python py/generate_game_cdn.py --check
178178
python py/update_encrypted_dns.py --check
179179
python py/generate_rules.py --check --mihomo mihomo
180-
python py/generate_stash_configs.py --check
180+
python py/generate_stash_configs.py --check --target mainland
181181
182182
- name: Validate complete Mihomo templates
183183
run: |

cfg/Custom_Stash.ini

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)