ci: fix release scripts
This commit is contained in:
parent
4933c7107b
commit
e392d0db9b
11
.github/scripts/upload.py
vendored
11
.github/scripts/upload.py
vendored
@ -64,6 +64,8 @@ def sendMessage(message, user_id = BOT_TARGET, entities = None) -> int:
|
||||
"text": message,
|
||||
"entities": entities
|
||||
}
|
||||
print(message)
|
||||
print(entities)
|
||||
resp = requests.post(API_PREFIX + "sendMessage", json=data).json()
|
||||
print(resp)
|
||||
return int(resp["result"]["message_id"])
|
||||
@ -105,6 +107,8 @@ def sendRelease():
|
||||
text += " "
|
||||
text += addEntity(entities, text, "bold", VERSION_NAME)
|
||||
text += "\n\n"
|
||||
if "entities" not in admin_resp:
|
||||
admin_resp["entities"] = list()
|
||||
resp_entities = admin_resp["entities"]
|
||||
for en in resp_entities:
|
||||
copy = en.copy()
|
||||
@ -140,9 +144,10 @@ if __name__ == '__main__':
|
||||
print(sys.argv)
|
||||
if len(sys.argv) != 2:
|
||||
print("Run Type: release, ci, debug")
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
exit(1)
|
||||
mode = sys.argv[1]
|
||||
try:
|
||||
if mode == "release":
|
||||
sendRelease()
|
||||
elif mode == "ci":
|
||||
@ -156,8 +161,4 @@ if __name__ == '__main__':
|
||||
sendRelease()
|
||||
else:
|
||||
print("unknown mode")
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
exit(1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user