improve checkupdate

pull/3403/head
ruki 9 months ago
parent 00384e5b3d
commit 3e6d34e834
  1. 6
      scripts/autoupdate.lua
  2. 4
      scripts/checkupdate.lua

@ -84,9 +84,9 @@ function _update_version(instance, version, shasum)
instance:name(), version_current, version)
os.vexec("git add .")
os.vexec("git commit -a -m \"Update %s to %s\"", instance:name(), version)
--os.vexec("git push %s %s:%s", repourl, branch, branch)
--os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s",
-- instance:name(), version, body, branch)
os.vexec("git push %s %s:%s", repourl, branch, branch)
os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s",
instance:name(), version, body, branch)
end
os.vexec("git reset --hard HEAD")
os.vexec("git checkout %s", branch_current)

@ -85,7 +85,11 @@ function _check_version_from_github_releases(package, url)
local version_latest
for _, line in ipairs(list:split("\n")) do
local splitinfo = line:split("%s+")
local release = splitinfo[1]
local version = splitinfo[#splitinfo - 1]
if not version or not _is_valid_version(version) and _is_valid_version(release) then
version = release
end
if version and _is_valid_version(version) then
version_latest = version
break

Loading…
Cancel
Save