Files
firefox/taskcluster/taskgraph/util/signed_artifacts.py
T
Johan Lorenzo bc0780f4ac Bug 1383771 - Add widevine support to Nightly builds r=aki a=merge
Other related changes:
* Only target.{zip,tar.gz,tar.bz} get the widevine signature (not the various installers).
* Linux{32,64}-nightly are now repackaged. Their mar files are not signed during signed step anymore. It now happens after the repackage.
* As a consequence, funsize routes for linux are now set to repackage-signing (instead of signing)
* Signed upstream artifacts are now defined in a dedicated module (to avoid duplication)
* Platforms defined in beetmover_repackage now allow regex (to reduce duplication too)
* Mozharness configs: Delete unused (and misleading) `src_mozconfig` for windows. This value is actually not used when `run_configure` (in the same dict) is set to False.

MozReview-Commit-ID: COKqevW9Mzn
2017-08-10 19:25:36 +02:00

62 lines
2.2 KiB
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Defines artifacts to sign before repackage.
"""
def generate_specifications_of_artifacts_to_sign(
build_platform, is_nightly=False, keep_locale_template=True
):
if 'android' in build_platform:
artifacts_specifications = [{
'artifacts': [
'public/build/{locale}/target.apk',
],
'formats': ['jar'],
}]
# XXX: Mars aren't signed here (on any platform) because internals will be
# signed at after this stage of the release
elif 'macosx' in build_platform:
artifacts_specifications = [{
'artifacts': ['public/build/{locale}/target.dmg'],
'formats': ['macapp', 'widevine'],
}]
elif 'win' in build_platform:
artifacts_specifications = [{
'artifacts': [
'public/build/{locale}/setup.exe',
],
'formats': ['sha2signcode'],
}, {
'artifacts': [
'public/build/{locale}/target.zip',
],
'formats': ['sha2signcode', 'widevine'],
}]
if 'win32' in build_platform and is_nightly:
artifacts_specifications[0]['artifacts'] += ['public/build/{locale}/setup-stub.exe']
elif 'linux' in build_platform:
artifacts_specifications = [{
'artifacts': ['public/build/{locale}/target.tar.bz2'],
'formats': ['gpg', 'widevine'],
}]
else:
raise Exception("Platform not implemented for signing")
if not keep_locale_template:
artifacts_specifications = _strip_locale_template(artifacts_specifications)
return artifacts_specifications
def _strip_locale_template(artifacts_without_locales):
for spec in artifacts_without_locales:
for index, artifact in enumerate(spec['artifacts']):
stripped_artifact = artifact.format(locale='')
stripped_artifact = stripped_artifact.replace('//', '/')
spec['artifacts'][index] = stripped_artifact
return artifacts_without_locales