[workflows] release standalone executables in gdl-org/builds

needs some form of release notes,
probably just git commits since last stable release
This commit is contained in:
Mike Fährmann
2024-03-08 23:13:53 +01:00
parent 146459056c
commit 3c979e1f05
3 changed files with 82 additions and 20 deletions

View File

@@ -4,16 +4,34 @@
"""Build a standalone executable using PyInstaller"""
import PyInstaller.__main__
import argparse
import util
import os
import sys
PyInstaller.__main__.run([
"--onefile",
"--console",
"--name", "gallery-dl." + ("exe" if os.name == "nt" else "bin"),
"--additional-hooks-dir", util.path("scripts"),
"--distpath", util.path("dist"),
"--workpath", util.path("build"),
"--specpath", util.path("build"),
util.path("gallery_dl", "__main__.py"),
])
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--os")
parser.add_argument("-a", "--arch")
args = parser.parse_args()
name = "gallery-dl"
if args.os:
name = "{}_{}".format(name, args.os.partition("-")[0].lower())
if args.arch == "x86":
name += "_x86"
PyInstaller.__main__.run([
"--onefile",
"--console",
"--name", name,
"--additional-hooks-dir", util.path("scripts"),
"--distpath", util.path("dist"),
"--workpath", util.path("build"),
"--specpath", util.path("build"),
util.path("gallery_dl", "__main__.py"),
])
if __name__ == "__main__":
sys.exit(main())