mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
Update webupdater release script
This commit is contained in:
17
.github/workflow_data/webupdater.py
vendored
17
.github/workflow_data/webupdater.py
vendored
@@ -1,9 +1,11 @@
|
||||
import nextcloud_client
|
||||
import json
|
||||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
client = nextcloud_client.Client(os.environ["NC_HOST"])
|
||||
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])
|
||||
|
||||
file = os.environ["NC_FILE"]
|
||||
path = os.environ["NC_PATH"] + "/" + file
|
||||
try:
|
||||
@@ -11,6 +13,15 @@ if __name__ == "__main__":
|
||||
except Exception:
|
||||
pass
|
||||
client.put_file(path, file)
|
||||
share_link = client.share_file_with_link(path).get_link()
|
||||
download_link = share_link.rstrip("/") + "/download/" + file
|
||||
print(download_link, end="")
|
||||
|
||||
file = file.removesuffix(".tgz") + ".md"
|
||||
path = path.removesuffix(".tgz") + ".md"
|
||||
with open(os.environ['GITHUB_EVENT_PATH'], "r") as f:
|
||||
changelog = json.load(f)['pull_request']['body']
|
||||
with open(file, "w") as f:
|
||||
f.write(changelog)
|
||||
try:
|
||||
client.delete(path)
|
||||
except Exception:
|
||||
pass
|
||||
client.put_file(path, file)
|
||||
|
||||
Reference in New Issue
Block a user