🔧 迁移到 git.garfieldho.me/moon-source

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
GarfieldandCopilot committed 2026-11-18 21:44:39 +08:00
1 parent 24224b034a
commit 9dbfed3a51
4 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ on:
jobs: jobs:
release: release:
runs-on: codeberg-tiny runs-on: docker
container: container:
image: node:22-bookworm image: node:22-bookworm
steps: steps:
+3 -3
View File
@@ -1,6 +1,6 @@
# 月读书源:知乎盐选 # 月读书源:知乎盐选
给月读增加「知乎盐选」在线书源的 KOReader 插件。本仓库只含这一个插件,独立维护、独立发版,全部书源见 [GarfieldMoon 组织](https://codeberg.org/GarfieldMoon)。 给月读增加「知乎盐选」在线书源的 KOReader 插件。本仓库只含这一个插件,独立维护、独立发版,全部书源见 [moon-source 组织](https://git.garfieldho.me/moon-source)。
## 免责声明 ## 免责声明
@@ -26,7 +26,7 @@
## 发布 ## 发布
推送 `vX.Y.Z` 标签(带 `-` 的如 `v1.2.0-rc.1` 为预发布),Codeberg Actions 会打包 `moonsource-zhihu.koplugin-<版本>.zip`,连同 `SHA256SUMS` 上传到 Release。 推送 `vX.Y.Z` 标签(带 `-` 的如 `v1.2.0-rc.1` 为预发布),Forgejo Actions 会打包 `moonsource-zhihu.koplugin-<版本>.zip`,连同 `SHA256SUMS` 上传到 Release。
更新日志写在 `CHANGELOG.md`,格式是 `## <版本号>` 一节,发布时取对应小节作为 Release 说明(月读的更新弹窗也会显示)。无需配置密钥,默认用内置令牌。本地打包:`tools/package.sh <版本> [输出目录]`。 更新日志写在 `CHANGELOG.md`,格式是 `## <版本号>` 一节,发布时取对应小节作为 Release 说明(月读的更新弹窗也会显示)。无需配置密钥,默认用内置令牌。本地打包:`tools/package.sh <版本> [输出目录]`。
## 测试 ## 测试
@@ -40,7 +40,7 @@ MOON_DIR=/path/to/moon tools/run-tests.sh tests/zhihu/xxx_spec.lua
## 公共文件 ## 公共文件
`<包名>/update.lua`、`tools/package.sh`、`tools/run-tests.sh`、`.forgejo/workflows/release.yml`、`tests/update/update_spec.lua` 由 [moonsource-template](https://codeberg.org/GarfieldMoon/moonsource-template) 同步,请改模板仓库,不要在这里手改。 `<包名>/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) 同步,请改模板仓库,不要在这里手改。
## 许可 ## 许可
@@ -1,10 +1,10 @@
--[[-- --[[--
书源插件在线更新(Codeberg Release)。 书源插件在线更新(Forgejo Release)。
本文件是 moonsource-template 仓库 common/update.lua 的副本,由 tools/sync.sh 同步到每个插件仓库的 本文件是 moonsource-template 仓库 common/update.lua 的副本,由 tools/sync.sh 同步到每个插件仓库的
<包名>/update.lua,请改模板仓库,不要手改副本。 <包名>/update.lua,请改模板仓库,不要手改副本。
每个插件在自己的仓库(GarfieldMoon/moonsource-<名字>)独立发版,只检查并更新它自己: 每个插件在自己的仓库(moon-source/moonsource-<名字>)独立发版,只检查并更新它自己:
仓库名和目录名都由包名(require 时的模块名)推出,包体校验值取自同一 Release 的 SHA256SUMS。 仓库名和目录名都由包名(require 时的模块名)推出,包体校验值取自同一 Release 的 SHA256SUMS。
@module moonsource.update @module moonsource.update
@@ -13,8 +13,8 @@
local PKG = (...):match("^(.-)%.update$") local PKG = (...):match("^(.-)%.update$")
local NAME = PKG:gsub("_", "-") local NAME = PKG:gsub("_", "-")
local DIR = NAME .. ".koplugin" local DIR = NAME .. ".koplugin"
local REPO = "GarfieldMoon/" .. NAME local REPO = "moon-source/" .. NAME
local SITE = "https://codeberg.org" local SITE = "https://git.garfieldho.me"
local API = SITE .. "/api/v1/repos/" .. REPO .. "/releases/latest" local API = SITE .. "/api/v1/repos/" .. REPO .. "/releases/latest"
local CHECK_INTERVAL = 24 * 60 * 60 local CHECK_INTERVAL = 24 * 60 * 60
local MAX_ARCHIVE_BYTES = 50 * 1024 * 1024 local MAX_ARCHIVE_BYTES = 50 * 1024 * 1024
+3 -3
View File
@@ -7,7 +7,7 @@ local Json = require("support.json_stub")
local PKG = "moonsource_zhihu" local PKG = "moonsource_zhihu"
local DIR = "moonsource-zhihu.koplugin" local DIR = "moonsource-zhihu.koplugin"
local REPO = "GarfieldMoon/" .. DIR:gsub("%.koplugin$", "") local REPO = "moon-source/" .. DIR:gsub("%.koplugin$", "")
local cfg = {} local cfg = {}
package.preload["utils.settings"] = function() package.preload["utils.settings"] = function()
@@ -18,7 +18,7 @@ package.preload["utils.text"] = function()
end end
package.preload["http.timeout"] = function() return { net = function() return 5 end } end package.preload["http.timeout"] = function() return { net = function() return 5 end } end
local BASE = "https://codeberg.org/" .. REPO .. "/releases/download/v1.2.3/" local BASE = "https://git.garfieldho.me/" .. REPO .. "/releases/download/v1.2.3/"
local zip = DIR .. "-1.2.3.zip" local zip = DIR .. "-1.2.3.zip"
local other = "moonsource-other.koplugin-1.2.3.zip" local other = "moonsource-other.koplugin-1.2.3.zip"
local release = { local release = {
@@ -54,7 +54,7 @@ Assert.is_true(Update.newer("0.0.1", "0.0.0-dev"))
local got, err local got, err
Update.check(function(r, e) got, err = r, e end) Update.check(function(r, e) got, err = r, e end)
Assert.is_nil(err) Assert.is_nil(err)
Assert.eq(requested[1], "https://codeberg.org/api/v1/repos/" .. REPO .. "/releases/latest") Assert.eq(requested[1], "https://git.garfieldho.me/api/v1/repos/" .. REPO .. "/releases/latest")
Assert.eq(got.version, "1.2.3") Assert.eq(got.version, "1.2.3")
Assert.eq(got.notes, "更新说明") Assert.eq(got.notes, "更新说明")
Assert.is_true(got.available) Assert.is_true(got.available)