From d528f3811a3d67933904f1d714dbe2d1f4d9b9db Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 23 Dec 2018 10:16:08 -0500 Subject: [PATCH] Use version number in the filename of packages --- .travis.yml | 4 ++-- dist/chromium/publish-beta.py | 14 +++++++------- dist/firefox/publish-signed-beta.py | 20 ++++++++++---------- dist/firefox/updates.template.json | 2 +- tools/make-chromium.sh | 7 ++++++- tools/make-firefox.sh | 5 +++++ tools/make-webext.sh | 5 +++++ 7 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa6c8ba38..1c9849477 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,13 @@ env: matrix: - BROWSER=chromium EXT=zip - BROWSER=firefox EXT=xpi -script: ./tools/make-${BROWSER}.sh all +script: ./tools/make-${BROWSER}.sh ${TRAVIS_TAG} deploy: provider: releases prerelease: true api_key: secure: EnAMNsPbnS2I0JDkCWiY/6WLERsUbE2Ni5j9ap8YbZt4+sJv7aSoufWZ+0TZvSwr/w5MKCCDKhwXaPfbUwvqrI+eZv6LBXhwajK9Zla25FVjtdGCwKXQ3ZU85PHgL+5FYtuSGACmQj/ruAdSgrI7PgS08e5lqSgEk6lY4y3/6fE= - file: dist/build/uBlock0.${BROWSER}.${EXT} + file: dist/build/uBlock0_${TRAVIS_TAG}.${BROWSER}.${EXT} skip_cleanup: true on: repo: gorhill/uBlock diff --git a/dist/chromium/publish-beta.py b/dist/chromium/publish-beta.py index c3985a5c9..03e781e13 100755 --- a/dist/chromium/publish-beta.py +++ b/dist/chromium/publish-beta.py @@ -27,13 +27,6 @@ projdir = os.path.split(os.path.abspath(__file__))[0] while not os.path.isdir(os.path.join(projdir, '.git')): projdir = os.path.normpath(os.path.join(projdir, '..')) -cs_extension_id = 'cgbcahbpdhpcegmbfconppldiemgcoii' -tmpdir = tempfile.TemporaryDirectory() -raw_zip_filename = 'uBlock0.chromium.zip' -raw_zip_filepath = os.path.join(tmpdir.name, raw_zip_filename) -github_owner = 'gorhill' -github_repo = 'uBlock' - # We need a version string to work with if len(sys.argv) >= 2 and sys.argv[1]: version = sys.argv[1] @@ -44,6 +37,13 @@ if not re.search('^\d+\.\d+\.\d+(b|rc)\d+$', version): print('Error: Invalid version string.') exit(1) +cs_extension_id = 'cgbcahbpdhpcegmbfconppldiemgcoii' +tmpdir = tempfile.TemporaryDirectory() +raw_zip_filename = 'uBlock0_' + version + '.chromium.zip' +raw_zip_filepath = os.path.join(tmpdir.name, raw_zip_filename) +github_owner = 'gorhill' +github_repo = 'uBlock' + # Load/save auth secrets # The build directory is excluded from git ubo_secrets = dict() diff --git a/dist/firefox/publish-signed-beta.py b/dist/firefox/publish-signed-beta.py index c5dd14cc7..3f0b526fe 100755 --- a/dist/firefox/publish-signed-beta.py +++ b/dist/firefox/publish-signed-beta.py @@ -42,16 +42,6 @@ if not os.path.isfile(version_filepath): print('Version file not found.') exit(1) -extension_id = 'uBlock0@raymondhill.net' -tmpdir = tempfile.TemporaryDirectory() -raw_xpi_filename = 'uBlock0.firefox.xpi' -raw_xpi_filepath = os.path.join(tmpdir.name, raw_xpi_filename) -unsigned_xpi_filepath = os.path.join(tmpdir.name, 'uBlock0.firefox.unsigned.xpi') -signed_xpi_filename = 'uBlock0.firefox.signed.xpi' -signed_xpi_filepath = os.path.join(tmpdir.name, signed_xpi_filename) -github_owner = 'gorhill' -github_repo = 'uBlock' - # We need a version string to work with if len(sys.argv) >= 2 and sys.argv[1]: tag_version = sys.argv[1] @@ -69,6 +59,16 @@ if match.group(2): revision += 100; ext_version += '.' + str(revision) +extension_id = 'uBlock0@raymondhill.net' +tmpdir = tempfile.TemporaryDirectory() +raw_xpi_filename = 'uBlock0_' + tag_version + '.firefox.xpi' +raw_xpi_filepath = os.path.join(tmpdir.name, raw_xpi_filename) +unsigned_xpi_filepath = os.path.join(tmpdir.name, 'uBlock0.firefox.unsigned.xpi') +signed_xpi_filename = 'uBlock0_' + tag_version + '.firefox.signed.xpi' +signed_xpi_filepath = os.path.join(tmpdir.name, signed_xpi_filename) +github_owner = 'gorhill' +github_repo = 'uBlock' + # Load/save auth secrets # The build directory is excluded from git ubo_secrets = dict() diff --git a/dist/firefox/updates.template.json b/dist/firefox/updates.template.json index 962d2ed0d..014f7b6ca 100644 --- a/dist/firefox/updates.template.json +++ b/dist/firefox/updates.template.json @@ -6,7 +6,7 @@ "version": "$ext_version", "applications": { "gecko": { "strict_min_version": "52" } }, "update_info_url": "https://github.com/gorhill/uBlock/releases/tag/$tag_version", - "update_link": "https://github.com/gorhill/uBlock/releases/download/$tag_version/uBlock0.firefox.signed.xpi" + "update_link": "https://github.com/gorhill/uBlock/releases/download/$tag_version/uBlock0_$tag_version.firefox.signed.xpi" } ] } diff --git a/tools/make-chromium.sh b/tools/make-chromium.sh index 786fe46a0..d473744fe 100755 --- a/tools/make-chromium.sh +++ b/tools/make-chromium.sh @@ -46,10 +46,15 @@ echo "*** uBlock0.chromium: Generating meta..." python tools/make-chromium-meta.py $DES/ if [ "$1" = all ]; then - echo "*** uBlock0.chromium: Creating package..." + echo "*** uBlock0.chromium: Creating plain package..." pushd $(dirname $DES/) > /dev/null zip uBlock0.chromium.zip -qr $(basename $DES/)/* popd > /dev/null +elif [ -n "$1" ]; then + echo "*** uBlock0.chromium: Creating versioned package..." + pushd $(dirname $DES/) > /dev/null + zip uBlock0_"$1".chromium.zip -qr $(basename $DES/)/* + popd > /dev/null fi echo "*** uBlock0.chromium: Package done." diff --git a/tools/make-firefox.sh b/tools/make-firefox.sh index 8606be8f5..860e5de9a 100755 --- a/tools/make-firefox.sh +++ b/tools/make-firefox.sh @@ -53,6 +53,11 @@ if [ "$1" = all ]; then pushd $DES > /dev/null zip ../$(basename $DES).xpi -qr * popd > /dev/null +elif [ -n "$1" ]; then + echo "*** uBlock0.firefox: Creating versioned package..." + pushd $DES > /dev/null + zip ../$(basename $DES).xpi -qr * -O ../uBlock0_"$1".firefox.xpi + popd > /dev/null fi echo "*** uBlock0.firefox: Package done." diff --git a/tools/make-webext.sh b/tools/make-webext.sh index cb0ec9fe2..d65f53ef5 100755 --- a/tools/make-webext.sh +++ b/tools/make-webext.sh @@ -55,6 +55,11 @@ if [ "$1" = all ]; then pushd $DES > /dev/null zip ../$(basename $DES).xpi -qr * popd > /dev/null +elif [ -n "$1" ]; then + echo "*** uBlock0.webext: Creating versioned package..." + pushd $DES > /dev/null + zip ../$(basename $DES).xpi -qr * -O ../uBlock0_"$1".webext.xpi + popd > /dev/null fi echo "*** uBlock0.webext: Package done."