1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-24 19:52:32 +01:00

[scripts] update release.py

build Linux binary in ubuntu22.04 VM
This commit is contained in:
Mike Fährmann 2024-03-11 21:35:50 +01:00
parent 4565de3c8e
commit 4ccdba8ccb
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 30 additions and 15 deletions

View File

@ -13,6 +13,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--os")
parser.add_argument("-a", "--arch")
parser.add_argument("-e", "--extension")
args = parser.parse_args()
name = "gallery-dl"
@ -20,6 +21,8 @@ def main():
name = "{}_{}".format(name, args.os.partition("-")[0].lower())
if args.arch == "x86":
name += "_x86"
if args.extension:
name = "{}.{}".format(name, args.extension.lower())
PyInstaller.__main__.run([
"--onefile",

View File

@ -53,31 +53,43 @@ build-linux() {
cd "${ROOTDIR}"
echo Building Linux executable
VENV_PATH="/tmp/venv"
VENV_PYTHON="${VENV_PATH}/bin/python"
rm -rf "${VENV_PATH}"
python -m virtualenv "${VENV_PATH}"
$VENV_PYTHON -m pip install requests requests[socks] yt-dlp pyyaml secretstorage pyinstaller
$VENV_PYTHON ./scripts/pyinstaller.py
build-vm 'ubuntu22.04' 'gallery-dl.bin'
}
build-windows() {
cd "${ROOTDIR}/dist"
cd "${ROOTDIR}"
echo Building Windows executable
# remove old executable
rm -f "gallery-dl.exe"
build-vm 'windows7_x86_sp1' 'gallery-dl.exe'
}
# build windows exe in vm
ln -fs "${ROOTDIR}" /tmp/
vmstart "windows7_x86_sp1" &
build-vm() {
VMNAME="$1"
BINNAME="$2"
TMPPATH="/tmp/gallery-dl/dist/$BINNAME"
# launch VM
vmstart "$VMNAME" &
disown
while [ ! -e "gallery-dl.exe" ] ; do
# copy source files
mkdir -p /tmp/gallery-dl
cp -a -t /tmp/gallery-dl -- \
./gallery_dl ./scripts ./data ./setup.py ./README.rst
# remove old executable
rm -f "./dist/$BINNAME"
# wait for new executable
while [ ! -e "$TMPPATH" ] ; do
sleep 5
done
sleep 2
# move
mv "$TMPPATH" "./dist/$BINNAME"
rm -r /tmp/gallery-dl
}
sign() {