Skip to content

Commit 027268a

Browse files
committed
workaround release file limit
1 parent b45924c commit 027268a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

release.lua

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ function main()
3838
end
3939
end
4040

41+
local files = {}
42+
table.join2(files, os.files(path.join(dir, "**.7z")))
43+
table.join2(files, os.files(path.join(dir, "**.tar.xz")))
44+
4145
local binaries = {}
42-
table.join2(binaries, os.files(path.join(dir, "**.7z")))
43-
table.join2(binaries, os.files(path.join(dir, "**.tar.xz")))
46+
for _, i in ipairs(files) do
47+
local file = io.open(i, "r")
48+
local size, error = file:size()
49+
-- github release limit 2 Gib
50+
if size > 2 * 1024 * 1024 * 1024 then
51+
print("%s > 2 Gib, skip", path.filename(i))
52+
print(file)
53+
else
54+
table.insert(binaries, i)
55+
end
56+
end
4457

4558
print(binaries)
4659

0 commit comments

Comments
 (0)