[WIP] Move the release process to github actions.

This commit is contained in:
Matthieu Gautier
2020-05-19 12:06:53 +02:00
parent 763fe1432d
commit e020eb35ac
10 changed files with 615 additions and 31 deletions

View File

@ -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_))