From f40e584b956c07bd85e649d97153c8560574dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 16 Sep 2018 07:51:22 +0100 Subject: [PATCH] release: make runnable again Create download-latest-release helper --- README.adoc | 2 +- download-latest-release | 11 +++++++++++ release | 5 +++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 download-latest-release mode change 100644 => 100755 release diff --git a/README.adoc b/README.adoc index d44e4b3..432b090 100644 --- a/README.adoc +++ b/README.adoc @@ -562,7 +562,7 @@ Checkout to the prebuilt repo version so that the scripts and documentation will .... git checkout -git submodule update --init "$(./getvar qemu_src_dir)" +git submodule update --init --recursive "$(./getvar qemu_src_dir)" ./build-qemu ./run .... diff --git a/download-latest-release b/download-latest-release new file mode 100755 index 0000000..be90a24 --- /dev/null +++ b/download-latest-release @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import json +import urllib.request + +_json = json.loads(urllib.request.urlopen(urllib.request.Request( + 'https://api.github.com/repos/cirosantilli/linux-kernel-module-cheat/releases', + headers={'Accept' : 'application/vnd.github.full+json"text/html'} +)).read()) +asset = _json[0]['assets'][0] +urllib.request.urlretrieve(asset['browser_download_url'], asset['name']) diff --git a/release b/release old mode 100644 new mode 100755 index c9df514..d013669 --- a/release +++ b/release @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import imp import os import subprocess @@ -15,8 +16,8 @@ subprocess.check_call([os.path.join(common.root_dir, 'test')]) subprocess.check_call([os.path.join(common.root_dir, 'build-all')]) zip_img.main() tag = 'sha-{}'.format(common.sha) -subprocess.check_call(['git', 'tag', tag]) -subprocess.check_call(['git', 'push' '--tags']) +subprocess.check_call(['git', 'tag', '-f', tag]) +subprocess.check_call(['git', 'push', '--tags']) # TODO # - https://stackoverflow.com/questions/41022470/curl-request-to-add-file-to-github-release # - https://stackoverflow.com/questions/38627115/upload-files-to-github-directory-using-github-api