relax conditions on building artifacts (#4802)

pull/4809/head
Hoildkv 4 months ago committed by GitHub
parent f8bae8b14d
commit b507b7a077
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      scripts/build_artifacts.lua

@ -14,6 +14,10 @@ function _load_package(packagename, packagedir, packagefile)
end end
end end
function _need_artifact(instance)
return (not instance:is_headeronly()) and (packages_util.is_supported(instance, "windows", "x64") or packages_util.is_supported(instance, "windows", "x86"))
end
function _build_artifacts(name, versions) function _build_artifacts(name, versions)
local buildinfo = {name = name, versions = versions} local buildinfo = {name = name, versions = versions}
print(buildinfo) print(buildinfo)
@ -60,8 +64,7 @@ function _get_latest_modified_packages()
local packagename = path.filename(packagedir) local packagename = path.filename(packagedir)
if #path.filename(path.directory(packagedir)) == 1 then if #path.filename(path.directory(packagedir)) == 1 then
local instance = _load_package(packagename, packagedir, file) local instance = _load_package(packagename, packagedir, file)
if instance and packages_util.is_supported(instance, "windows") if instance and _need_artifact(instance) then
and (instance.is_headeronly and not instance:is_headeronly()) then
table.insert(instances, instance) table.insert(instances, instance)
print(" > %s", instance:name()) print(" > %s", instance:name())
end end
@ -86,8 +89,7 @@ function _get_all_packages()
local basefile = path.join(basedir, "xmake.lua") local basefile = path.join(basedir, "xmake.lua")
instance._BASE = _load_package(basename, basedir, basefile) instance._BASE = _load_package(basename, basedir, basefile)
end end
if instance and packages_util.is_supported(instance, "windows") if instance and _need_artifact(instance) then
and (instance.is_headeronly and not instance:is_headeronly()) then
table.insert(packages, instance) table.insert(packages, instance)
end end
end end
@ -128,8 +130,7 @@ function _get_packagerefs_in_latest_24h()
local packagename = path.filename(packagedir) local packagename = path.filename(packagedir)
if #path.filename(path.directory(packagedir)) == 1 then if #path.filename(path.directory(packagedir)) == 1 then
local instance = _load_package(packagename, packagedir, file) local instance = _load_package(packagename, packagedir, file)
if instance and packages_util.is_supported(instance, "windows") if instance and _need_artifact(instance) then
and (instance.is_headeronly and not instance:is_headeronly()) then
table.insert(instances, instance) table.insert(instances, instance)
end end
end end

Loading…
Cancel
Save