mirror of
https://github.com/kiwix/kiwix-build.git
synced 2025-06-26 10:11:27 +00:00
[WIP] Move the release process to github actions.
This commit is contained in:
@ -54,6 +54,19 @@ def upload(version, filepath, artefact):
|
||||
return True
|
||||
|
||||
|
||||
def upload_from_json(json_path):
|
||||
basedir = os.path.dirname(json_path)
|
||||
with open(str(json_path)) as f:
|
||||
options = json.load(f)
|
||||
|
||||
if not create_version(options['version']):
|
||||
raise RuntimeError("Cannot create version")
|
||||
|
||||
for file_ in options['files']:
|
||||
path = os.path.join(basedir, file_)
|
||||
if not upload(options['version'], path, file_):
|
||||
raise RuntimeError("Cannot upload file {}".format(file_))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
@ -63,14 +76,8 @@ if __name__ == "__main__":
|
||||
sys.exit(-1)
|
||||
|
||||
print("Use info file {}".format(info_file))
|
||||
with open(info_file) as f:
|
||||
options = json.load(f)
|
||||
try:
|
||||
upload_from_json(info_file)
|
||||
except RuntimeError as e:
|
||||
sys.exit(str(e))
|
||||
|
||||
if not create_version(options['version']):
|
||||
sys.exit("Cannot create version")
|
||||
|
||||
basedir = os.path.dirname(sys.argv[1])
|
||||
for file_ in options['files']:
|
||||
path = os.path.join(basedir, file_)
|
||||
if not upload(options['version'], path, file_):
|
||||
sys.exit("Cannot upload file {}".format(file_))
|
||||
|
Reference in New Issue
Block a user