Use version number in the filename of packages

This commit is contained in:
Raymond Hill 2018-12-23 10:16:08 -05:00
parent f1567ee272
commit d528f3811a
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
7 changed files with 36 additions and 21 deletions

View file

@ -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

View file

@ -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()

View file

@ -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()

View file

@ -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"
}
]
}

View file

@ -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."

View file

@ -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."

View file

@ -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."