relase: make github operations perfect

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-09-17 09:36:36 +01:00
committed by Ciro Santilli
parent b2238daee3
commit 60f0e98644
6 changed files with 188 additions and 51 deletions

25
release-zip Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3
'''
https://github.com/cirosantilli/linux-kernel-module-cheat#release-zip
'''
import os
import subprocess
import zipfile
import common
def main():
os.makedirs(common.release_dir, exist_ok=True)
if os.path.exists(common.release_zip_file):
os.unlink(common.release_zip_file)
zipf = zipfile.ZipFile(common.release_zip_file, 'w', zipfile.ZIP_DEFLATED)
for arch in common.arches:
common.setup(common.get_argparse(default_args={'arch': arch}))
zipf.write(common.qcow2_file, arcname=os.path.relpath(common.qcow2_file, common.root_dir))
zipf.write(common.linux_image, arcname=os.path.relpath(common.linux_image, common.root_dir))
zipf.close()
if __name__ == '__main__':
main()