chore(ci): add checksums for nightly uploads (#4766)

This commit is contained in:
FineFindus 2023-09-13 11:07:18 +02:00 committed by GitHub
parent a33e118f10
commit a391630e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
.github/uploader.py vendored
View File

@ -1,6 +1,7 @@
from os import system as run, listdir, remove
from json import load
import tgconfig
import hashlib
with open("../.github/commit.json") as f:
data = load(f)
@ -18,6 +19,13 @@ if len(signed_files):
for file in unsigned_files:
remove(file)
with open("checksums", "w") as checksums:
for file in signed_files or unsigned_files:
with open(file, "rb") as apk:
bytes = apk.read()
sha256hash = hashlib.sha256(bytes).hexdigest()
checksums.write(sha256hash + " " + apk.name + "\n")
if tgconfig.GH_REPO.lower() == "libre-tube/libretube":
run("git add -f *")
run(f"git commit -m \"{message}\"")