removed old zip

This commit is contained in:
Bert van der Weerd 2022-02-28 23:52:32 +01:00
parent 563c053672
commit 58b2271e34
No known key found for this signature in database
GPG key ID: 4CFABB96ADE0F5B1
3 changed files with 32 additions and 26 deletions

View file

@ -28,7 +28,7 @@ veryclean : clean
rm -rf librewolf-$(shell cat version)-$(shell cat source_release) rm -rf librewolf-$(shell cat version)-$(shell cat source_release)
rm -f librewolf-$(shell cat version)-*.source.tar.gz rm -f librewolf-$(shell cat version)-*.source.tar.gz
fetch : fetch :
python3 mk.py fetch python3 mk.py fetch
build : build :
@ -43,7 +43,6 @@ artifacts :
check : README.md check : README.md
@python3 assets/update-version.py @python3 assets/update-version.py
@wget -q -O source_release https://gitlab.com/librewolf-community/browser/source/-/raw/main/release @wget -q -O source_release https://gitlab.com/librewolf-community/browser/source/-/raw/main/release
@echo "" @echo " Current Windows release:" $$(cat ./release)
@echo "Current release:" $$(cat ./release)

View file

@ -10,7 +10,7 @@ parser = optparse.OptionParser()
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true") parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
options, remainder = parser.parse_args() options, remainder = parser.parse_args()
bash_loc = 'd:/mozilla-build/msys/bin/bash.exe' bash_loc = 'c:/mozilla-build/msys/bin/bash.exe'
# native()/bash()/exec() utility functions # native()/bash()/exec() utility functions
def native(cmd,exit_on_fail = True,do_print=True): def native(cmd,exit_on_fail = True,do_print=True):
@ -39,7 +39,7 @@ def bash(cmd,exit_on_fail = True,do_print=True):
def exec(cmd,exit_on_fail = True, do_print=True): def exec(cmd,exit_on_fail = True, do_print=True):
_native = False _native = False
if not os.path.isfile(bash_lcc): if not os.path.isfile(bash_loc):
_native = True _native = True
if _native: if _native:
return native(cmd,exit_on_fail,do_print) return native(cmd,exit_on_fail,do_print)
@ -83,7 +83,7 @@ def firefox_release_url(ver):
return 'https://archive.mozilla.org/pub/firefox/releases/{}/source/firefox-{}.source.tar.xz'.format(ver, ver) return 'https://archive.mozilla.org/pub/firefox/releases/{}/source/firefox-{}.source.tar.xz'.format(ver, ver)
def check_url_exists(url): def check_url_exists(url):
i = exec('wget --spider {} 2>/dev/null'.format(url), exit_on_fail=False) i = exec('wget --spider {} 2>/dev/null'.format(url), do_print=False, exit_on_fail=False)
if i == 0: if i == 0:
return True return True
else: else:
@ -131,12 +131,12 @@ else:
s = base_version s = base_version
if s != base_version: if s != base_version:
print('The wheel has turned, and version {} has been released.'.format(s)) print('~ The wheel has turned, and version {} has been released. ~'.format(s))
with open('./version', 'w') as f: with open('./version', 'w') as f:
f.write(s) f.write(s)
exec('echo 0 > release') exec('echo 0 > release')
else: else:
print('Latest Firefox release is still {}.'.format(base_version)) print('- Latest Firefox release is still {}. -'.format(base_version))
sys.exit(0) # ensure 0 exit code sys.exit(0) # ensure 0 exit code

43
mk.py
View file

@ -3,6 +3,7 @@
import os,sys,subprocess,os.path import os,sys,subprocess,os.path
bash_loc = 'd:/mozilla-build/msys/bin/bash.exe' bash_loc = 'd:/mozilla-build/msys/bin/bash.exe'
do_zip = False
# native()/bash()/exec() utility functions # native()/bash()/exec() utility functions
def native(cmd,do_print=True): def native(cmd,do_print=True):
@ -106,7 +107,7 @@ def artifacts():
exec('cp -v librewolf-{}-{}/obj-x86_64-pc-mingw32/dist/{} .'.format(version,source_release,buildzip_filename)) exec('cp -v librewolf-{}-{}/obj-x86_64-pc-mingw32/dist/{} .'.format(version,source_release,buildzip_filename))
exec('rm -rf work && mkdir work') exec('rm -rf work && mkdir work')
os.chdir('work') os.chdir('work')
exec('unzip ../{}'.format(buildzip_filename)) exec('unzip -q ../{}'.format(buildzip_filename))
if not _with_app_name: if not _with_app_name:
exec('mv firefox librewolf') exec('mv firefox librewolf')
os.chdir('librewolf') os.chdir('librewolf')
@ -127,16 +128,17 @@ def artifacts():
exec('cp -v assets/librewolf.ico work/librewolf') exec('cp -v assets/librewolf.ico work/librewolf')
# Let's make the portable zip first. # Let's make the portable zip first.
os.chdir('work') if do_zip:
exec('rm -rf librewolf-{}'.format(version)) os.chdir('work')
os.makedirs('librewolf-{}/Profiles/Default'.format(version), exist_ok=True) exec('rm -rf librewolf-{}'.format(version))
os.makedirs('librewolf-{}/LibreWolf'.format(version), exist_ok=True) os.makedirs('librewolf-{}/Profiles/Default'.format(version), exist_ok=True)
exec('cp -vr librewolf/* librewolf-{}/LibreWolf'.format(version)) os.makedirs('librewolf-{}/LibreWolf'.format(version), exist_ok=True)
exec('wget -q -O librewolf-{}/librewolf-portable.exe https://gitlab.com/librewolf-community/browser/windows/uploads/64b929c39999d00efb56419f963e1b22/librewolf-portable.exe'.format(version)) exec('cp -r librewolf/* librewolf-{}/LibreWolf'.format(version))
zipname = 'librewolf-{}.en-US.win64.zip'.format(full_version) exec('wget -q -O librewolf-{}/librewolf-portable.exe https://gitlab.com/librewolf-community/browser/windows/uploads/64b929c39999d00efb56419f963e1b22/librewolf-portable.exe'.format(version))
exec("rm -f ../{}".format(zipname)) zipname = 'librewolf-{}.en-US.win64.zip'.format(full_version)
exec("zip -qr9 ../{} librewolf-{}".format(zipname,version)) exec("rm -f ../{}".format(zipname))
os.chdir('..') exec("zip -qr9 ../{} librewolf-{}".format(zipname,version))
os.chdir('..')
# With that out of the way, we need to create the main nsis setup. # With that out of the way, we need to create the main nsis setup.
os.chdir('work') os.chdir('work')
@ -157,7 +159,7 @@ def artifacts():
exec('rm -rf librewolf-{}'.format(version)) exec('rm -rf librewolf-{}'.format(version))
os.makedirs('librewolf-{}/Profiles/Default'.format(version), exist_ok=True) os.makedirs('librewolf-{}/Profiles/Default'.format(version), exist_ok=True)
os.makedirs('librewolf-{}/LibreWolf'.format(version), exist_ok=True) os.makedirs('librewolf-{}/LibreWolf'.format(version), exist_ok=True)
exec('cp -vr librewolf/* librewolf-{}/LibreWolf'.format(version)) exec('cp -r librewolf/* librewolf-{}/LibreWolf'.format(version))
# on gitlab: https://gitlab.com/ltGuillaume # on gitlab: https://gitlab.com/ltGuillaume
exec('git clone https://github.com/ltGuillaume/LibreWolf-Portable') exec('git clone https://github.com/ltGuillaume/LibreWolf-Portable')
exec('cp -v LibreWolf-Portable/LibreWolf-Portable.* LibreWolf-Portable/*.exe librewolf-{}/'.format(version)) exec('cp -v LibreWolf-Portable/LibreWolf-Portable.* LibreWolf-Portable/*.exe librewolf-{}/'.format(version))
@ -165,10 +167,10 @@ def artifacts():
# installed from: https://www.autohotkey.com/ # installed from: https://www.autohotkey.com/
exec('"c:/Program Files/AutoHotkey/Compiler/Ahk2Exe.exe" /in LibreWolf-Portable.ahk /icon LibreWolf-Portable.ico') exec('"c:/Program Files/AutoHotkey/Compiler/Ahk2Exe.exe" /in LibreWolf-Portable.ahk /icon LibreWolf-Portable.ico')
# let's remove the ahk and icon and embedded executables # let's remove the ahk and icon and embedded executables
exec('rm -vf LibreWolf-Portable.ahk LibreWolf-Portable.ico dejsonlz4.exe jsonlz4.exe') exec('rm -f LibreWolf-Portable.ahk LibreWolf-Portable.ico dejsonlz4.exe jsonlz4.exe')
os.chdir('..') os.chdir('..')
pa_zipname = 'librewolf-{}.en-US.win64.portable.zip'.format(full_version) pa_zipname = 'librewolf-{}.en-US.win64-portable.zip'.format(full_version)
exec("rm -f ../{}".format(pa_zipname)) exec("rm -f ../{}".format(pa_zipname))
exec("zip -qr9 ../{} librewolf-{}".format(pa_zipname,version)) exec("zip -qr9 ../{} librewolf-{}".format(pa_zipname,version))
@ -196,13 +198,18 @@ def upload(token):
full_version = '{}.{}'.format(version,release) full_version = '{}.{}'.format(version,release)
# Files we need to upload.. # Files we need to upload..
zip_filename = 'librewolf-{}.en-US.win64.zip'.format(full_version) if do_zip:
zip_filename = 'librewolf-{}.en-US.win64.zip'.format(full_version)
setup_filename = 'librewolf-{}.en-US.win64-setup.exe'.format(full_version) setup_filename = 'librewolf-{}.en-US.win64-setup.exe'.format(full_version)
pazip_filename = 'librewolf-{}.en-US.win64.portable.zip'.format(full_version) pazip_filename = 'librewolf-{}.en-US.win64-portable.zip'.format(full_version)
exec('sha256sum {} {} {} > sha256sums.txt'.format(setup_filename,zip_filename,pazip_filename)) if do_zip:
exec('sha256sum {} {} {} > sha256sums.txt'.format(setup_filename,zip_filename,pazip_filename))
else:
exec('sha256sum {} {} > sha256sums.txt'.format(setup_filename,pazip_filename))
exec('rm -f upload.txt') exec('rm -f upload.txt')
do_upload(setup_filename,token) do_upload(setup_filename,token)
do_upload(zip_filename,token) if do_zip:
do_upload(zip_filename,token)
do_upload(pazip_filename,token) do_upload(pazip_filename,token)
do_upload('sha256sums.txt',token) do_upload('sha256sums.txt',token)