🔧 工作流改放 .github/workflows(Gitea 兼容)

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
GarfieldandCopilot committed 2026-11-18 22:00:20 +08:00
1 parent e51460a8d0
commit b07e83db66
4 files changed
+5 -5

No files matched your search

File renamed without changes.
+1 -1
View File
@@ -11,7 +11,7 @@
| `common/update_spec.lua` | `tests/update/update_spec.lua` | 更新模块的离线测试 | | `common/update_spec.lua` | `tests/update/update_spec.lua` | 更新模块的离线测试 |
| `tools/package.sh` | `tools/package.sh` | 打包为 `moonsource-<名字>.koplugin-<版本>.zip` + `SHA256SUMS` | | `tools/package.sh` | `tools/package.sh` | 打包为 `moonsource-<名字>.koplugin-<版本>.zip` + `SHA256SUMS` |
| `tools/run-tests.sh` | `tools/run-tests.sh` | 借用月读仓库的测试运行器 | | `tools/run-tests.sh` | `tools/run-tests.sh` | 借用月读仓库的测试运行器 |
| `.forgejo/workflows/release.yml` | 同路径 | 推 `v*` 标签 → 打包 → 建 Release 并上传 | | `.github/workflows/release.yml` | 同路径 | 推 `v*` 标签 → 打包 → 建 Release 并上传 |
| `README.plugin.md` | `README.md`(缺失时生成) | 插件仓库 README 模板 | | `README.plugin.md` | `README.md`(缺失时生成) | 插件仓库 README 模板 |
| `plugins.tsv` | — | 书源名 → 显示名 | | `plugins.tsv` | — | 书源名 → 显示名 |
+1 -1
View File
@@ -40,7 +40,7 @@ MOON_DIR=/path/to/moon tools/run-tests.sh tests/@NAME@/xxx_spec.lua
## 公共文件 ## 公共文件
`<包名>/update.lua`、`tools/package.sh`、`tools/run-tests.sh`、`.forgejo/workflows/release.yml`、`tests/update/update_spec.lua` 由 [moonsource-template](https://git.garfieldho.me/moon-source/moonsource-template) 同步,请改模板仓库,不要在这里手改。 `<包名>/update.lua`、`tools/package.sh`、`tools/run-tests.sh`、`.github/workflows/release.yml`、`tests/update/update_spec.lua` 由 [moonsource-template](https://git.garfieldho.me/moon-source/moonsource-template) 同步,请改模板仓库,不要在这里手改。
## 许可 ## 许可
+3 -3
View File
@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# 把模板仓库里的公共文件同步进一个插件仓库。 # 把模板仓库里的公共文件同步进一个插件仓库。
# 用法:tools/sync.sh <插件仓库目录> # 用法:tools/sync.sh <插件仓库目录>
# 同步:<包名>/update.lua、tools/package.sh、tools/run-tests.sh、.forgejo/workflows/release.yml、 # 同步:<包名>/update.lua、tools/package.sh、tools/run-tests.sh、.github/workflows/release.yml、
# tests/update/update_spec.lua;缺失时补:<包名>/version.lua、CHANGELOG.md、LICENSE、.gitignore、README.md。 # tests/update/update_spec.lua;缺失时补:<包名>/version.lua、CHANGELOG.md、LICENSE、.gitignore、README.md。
set -eu set -eu
T="$(cd "$(dirname "$0")/.." && pwd)" T="$(cd "$(dirname "$0")/.." && pwd)"
@@ -12,11 +12,11 @@ PKG="moonsource_$NAME"
TITLE="$(awk -F'\t' -v n="$NAME" '$1==n {print $2}' "$T/plugins.tsv")" TITLE="$(awk -F'\t' -v n="$NAME" '$1==n {print $2}' "$T/plugins.tsv")"
[ -n "$TITLE" ] || { echo "plugins.tsv 里没有 $NAME" >&2; exit 1; } [ -n "$TITLE" ] || { echo "plugins.tsv 里没有 $NAME" >&2; exit 1; }
mkdir -p "$DEST/tools" "$DEST/.forgejo/workflows" "$DEST/tests/update" mkdir -p "$DEST/tools" "$DEST/.github/workflows" "$DEST/tests/update"
cp "$T/common/update.lua" "$DEST/$DIR/$PKG/update.lua" cp "$T/common/update.lua" "$DEST/$DIR/$PKG/update.lua"
[ -f "$DEST/$DIR/$PKG/version.lua" ] || cp "$T/common/version.lua" "$DEST/$DIR/$PKG/version.lua" [ -f "$DEST/$DIR/$PKG/version.lua" ] || cp "$T/common/version.lua" "$DEST/$DIR/$PKG/version.lua"
cp "$T/tools/package.sh" "$T/tools/run-tests.sh" "$DEST/tools/" cp "$T/tools/package.sh" "$T/tools/run-tests.sh" "$DEST/tools/"
cp "$T/.forgejo/workflows/release.yml" "$DEST/.forgejo/workflows/release.yml" cp "$T/.github/workflows/release.yml" "$DEST/.github/workflows/release.yml"
sed -e "s/@PKG@/$PKG/" -e "s/@DIR@/$DIR/" "$T/common/update_spec.lua" > "$DEST/tests/update/update_spec.lua" sed -e "s/@PKG@/$PKG/" -e "s/@DIR@/$DIR/" "$T/common/update_spec.lua" > "$DEST/tests/update/update_spec.lua"
[ -f "$DEST/LICENSE" ] || cp "$T/LICENSE" "$DEST/LICENSE" [ -f "$DEST/LICENSE" ] || cp "$T/LICENSE" "$DEST/LICENSE"
[ -f "$DEST/.gitignore" ] || printf '.DS_Store\n*.swp\ndist/\n.idea/\n' > "$DEST/.gitignore" [ -f "$DEST/.gitignore" ] || printf '.DS_Store\n*.swp\ndist/\n.idea/\n' > "$DEST/.gitignore"