Skip to content

Commit

Permalink
add a release zip builder
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jan 6, 2019
1 parent be2ff1c commit 8b6ee32
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions generate_release_zip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import zipfile
import sys
import urllib.request
import os

# massive hack but whatever

if len(sys.argv) != 3:
print("Usage: {} appveyor_job_id version_number".format(sys.argv[0]))
sys.exit(1)

zipf = zipfile.ZipFile("asar"+sys.argv[2]+".zip", 'x', compression=zipfile.ZIP_DEFLATED)

appveyor_prefix = "https://ci.appveyor.com/api/buildjobs/{}/artifacts/build/asar/MinSizeRel/".format(sys.argv[1])
with urllib.request.urlopen(appveyor_prefix + "asar-standalone.exe") as resp:
exe_data = resp.read()
with urllib.request.urlopen(appveyor_prefix + "asar.dll") as resp:
dll_data = resp.read()

zipf.writestr("asar.exe", exe_data)
zipf.writestr("dll/asar.dll", dll_data)

for (dirpath, dirnames, filenames) in os.walk("docs"):
for x in filenames:
zipf.write(dirpath + "/" + x)

for (dirpath, dirnames, filenames) in os.walk("ext"):
for x in filenames:
zipf.write(dirpath + "/" + x)

zipf.write("README.txt")
zipf.write("LICENSE")
zipf.write("license-gpl.txt")
zipf.write("license-lgpl.txt")
zipf.write("license-wtfpl.txt")

for (dirpath, dirnames, filenames) in os.walk("src/asar-dll-bindings"):
for x in filenames:
zipf.write(dirpath+"/"+x, dirpath.replace("src/asar-dll-bindings", "dll/bindings")+"/"+x)

0 comments on commit 8b6ee32

Please sign in to comment.