xlings: xim: xpkg增加自动匹配github上release的url功能
-
在包文件的xpm资源描述字段, 可以使用
github_release_tag
指定github上release的tag, 然后url就会变成一个支持正则表达的pattern, 能自动匹配release页面的特定文件例如下面这个包文件中使用这个功能可以在不修改包文件的情况下获取到最新的nightly版本
- windows - 使用"%.exe$"匹配对应的exe安装包
- linux - 使用"%.deb$"匹配deb安装包
具体的url匹配规则可以基于正则表达式自定义
package = { homepage = "https://project-graph.top", name = "project-graph", description = "快速绘制节点图的桌面工具 - 项目进程拓扑图绘制、头脑风暴草稿", maintainers = "LiRenTech", contributors = "https://github.com/LiRenTech/project-graph/graphs/contributors", licenses = "MIT", repo = "https://github.com/LiRenTech/project-graph", docs = "https://project-graph.top/getting-started", forum = "https://forum.d2learn.org/category/16/project-graph", -- xim pkg info type = "package", -- package, auto-config archs = {"x86_64", "aarch64"}, status = "stable", -- dev, stable, deprecated categories = {"desktop-tools", "graph-tools"}, xpm = { windows = { ["latest"] = { ref = "1.1.0" }, ["nightly"] = { url = "%.exe$", -- url pattern github_release_tag = "nightly", }, .... }, debian = { ["latest"] = { ref = "1.1.0" }, ["nightly"] = { url = "%.deb$", -- url pattern github_release_tag = "nightly", ... }, ubuntu = { ref = "debian" }, archlinux = { ref = "debian" }, manjaro = { ref = "debian" }, }, } ...
完整的包文件: https://github.com/d2learn/xim-pkgindex/blob/main/pkgs/p/project-graph.lua