-
Notifications
You must be signed in to change notification settings - Fork 0
/
r2zfx-esr-win32.py
29 lines (26 loc) · 1.09 KB
/
r2zfx-esr-win32.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 = "FIREFOX_ESR"
env_file = os.getenv('GITHUB_ENV') # https://stackoverflow.com/a/40698307
fxversion = mzlaJson("https://product-details.mozilla.org/1.0/firefox_versions.json",channel)
zipfilename = "firefox-esr-"+fxversion+"-it.win32.7z"
if checkversion(fxversion,"r2zfx-esr") == "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/firefox/releases/%s/win32/it/Firefox Setup %s.exe" % (fxversion,fxversion)
pkgname = "Firefox ESR Setup %s.exe" % fxversion
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("\nFXVERSION="+fxversion)
ghenv.write("\nFXZIPFILE="+zipfilename)