-
Notifications
You must be signed in to change notification settings - Fork 0
/
r2ztb-win64.py
29 lines (26 loc) · 1.11 KB
/
r2ztb-win64.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import os.path
import sys
from jsondiff import diff
from r2z_functions import *
channel = "LATEST_THUNDERBIRD_VERSION"
env_file = os.getenv('GITHUB_ENV') # https://stackoverflow.com/a/40698307
tbversion = mzlaJson("https://product-details.mozilla.org/1.0/thunderbird_versions.json",channel)
zipfilename = "thunderbird-"+tbversion+"-it.win64.7z"
if checkversion(tbversion,"r2ztb-64") == "same":
print("Same version, abort.")
with open(env_file, "a") as ghenv:
ghenv.write("DIFF=None\n")
sys.exit
else:
pkgpath = "https://ftp.mozilla.org/pub/thunderbird/releases/%s/win64/it/Thunderbird Setup %s.exe" % (tbversion,tbversion)
pkgname = "Thunderbird Setup %s.exe" % tbversion
download = mzlaDownload(pkgpath,pkgname)
print(channel,download)
# https://errorsfixing.com/how-to-set-environment-variables-in-github-actions-using-python/
# https://stackoverflow.com/a/70123641
with open(env_file, "a") as ghenv:
ghenv.write("CHANNEL="+channel)
ghenv.write("\nPKGNAME="+pkgname)
ghenv.write("\nTBVERSION="+tbversion)
ghenv.write("\nTBZIPFILE="+zipfilename)