Attempt to generate alpha update files
This commit is contained in:
parent
2932427ab0
commit
0b5ca8ddb3
@ -60,6 +60,7 @@ alpha32:
|
|||||||
- cd ..
|
- cd ..
|
||||||
- move src\socializer.zip socializer_x86.zip
|
- move src\socializer.zip socializer_x86.zip
|
||||||
- '%PYTHON3-32% scripts/upload.py'
|
- '%PYTHON3-32% scripts/upload.py'
|
||||||
|
- '%PYTHON3-32% scripts/generate_update_file.py'
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
- master
|
- master
|
||||||
|
32
scripts/generate_update_file.py
Normal file
32
scripts/generate_update_file.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
print("Generating update files for Socializer...")# Determine if we are going to write stable or alpha update file.
|
||||||
|
# Stable file is when we build tags and alpha otherwise.
|
||||||
|
version = os.environ.get("CI_COMMIT_TAG") or os.environ.get("CI_COMMIT_SHORT_SHA")
|
||||||
|
if os.environ.get("CI_COMMIT_TAG") == None:
|
||||||
|
version_type = "alpha"
|
||||||
|
else:
|
||||||
|
version_type = "stable"
|
||||||
|
print("Version detected: %s" % (version_type,))
|
||||||
|
|
||||||
|
# Read update description and URL'S
|
||||||
|
if version_type == "alpha":
|
||||||
|
description = os.environ.get("CI_COMMIT_MESSAGE")
|
||||||
|
urls = dict(win32="http://socializer.zip/static/files/alpha/socializer_x86_alpha.zip", win64="http://socializer.zip/static/files/alpha/socializer_x64_alpha.zip")
|
||||||
|
else:
|
||||||
|
with open("update-description",'r') as f:
|
||||||
|
description = f.read()
|
||||||
|
urls=dict(win32="http://socializer.su/static/files/{v}/socializer_{v}_x86.zip".format(v=version[1:]), win64="http://socializer.su/static/files/{v}/socializer_{v}_x64.zip".format(v=version[1:]))
|
||||||
|
|
||||||
|
# build the main dict object
|
||||||
|
data = dict(current_version=version, description=description, downloads=urls)
|
||||||
|
print("Generating file with the following arguments: %r" % (data,))
|
||||||
|
if version_type == "alpha":
|
||||||
|
updatefile = "alpha.json"
|
||||||
|
else:
|
||||||
|
updatefile = "stable.json"
|
||||||
|
f = open(updatefile, "w")
|
||||||
|
json.dump(data, f, ensure_ascii=False)
|
||||||
|
f.close()
|
1
update-description
Normal file
1
update-description
Normal file
@ -0,0 +1 @@
|
|||||||
|
это просто тест
|
Loading…
Reference in New Issue
Block a user