Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Update taskcluster scripts to support v2 signing (#1954)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Oct 16, 2019
1 parent 8641663 commit 781f57d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ tasks:
path: '/opt/FirefoxReality/builds/'
expires: {$fromNow: '1 month'}
metadata:
name: Firefox Reality for Android - Build - Master update
description: Building Firefox Reality for Android (via Gradle) - triggered by update to master or feature branch
name: Firefox Reality for Android - Build - ${event.ref[11:]} update
description: Building Firefox Reality for Android (via Gradle) - triggered by update to ${event.ref[11:]} branch
owner: [email protected]
source: ${repository}
###############################################################################
Expand Down Expand Up @@ -153,7 +153,7 @@ tasks:
expires: {$fromNow: '1 year'}
metadata:
name: Firefox Reality for Android - Release Build (${event.release.tag_name})
description: Building Firefox Reality for Android (via Gradle) - triggered by release
description: Building Firefox Reality for Android (via Gradle) - triggered by release (${event.release.tag_name})
owner: [email protected]
source: ${repository}

26 changes: 8 additions & 18 deletions tools/taskcluster/sign_apk.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def main(name, argv):


build_output_path = './app/build/outputs/apk'
# Create folder for saving build artifacts
artifacts_path = './builds'
if not os.path.exists(artifacts_path):
os.makedirs(artifacts_path)

# Sign APKs
for apk in glob.glob(build_output_path + "/*/*/*-unsigned.apk"):
Expand All @@ -50,24 +54,10 @@ def main(name, argv):
"-o", target,
"-H", "Authorization: " + token,
sign_url])

# Run zipalign
for apk in glob.glob(build_output_path + "/*/*/*-signed.apk"):
split = os.path.splitext(apk)
print subprocess.check_output(["zipalign", "-f", "-v", "-p", "4", apk, split[0] + "-aligned" + split[1]])

# Create folder for saving build artifacts
artifacts_path = './builds'
if not os.path.exists(artifacts_path):
os.makedirs(artifacts_path)

# Verify signature and move APK to artifact path
for apk in glob.glob(build_output_path + "/*/*/*-signed-*.apk"):
print "Verifying", apk
print subprocess.check_output(['apksigner', 'verify', apk])

print "Archiving", apk
os.rename(apk, artifacts_path + "/" + os.path.basename(apk))
print "Verifying", target
print subprocess.check_output(['apksigner', 'verify', target])
print "Archiving", target
os.rename(target, artifacts_path + "/" + os.path.basename(target))

if __name__ == "__main__":
main(sys.argv[0], sys.argv[1:])

0 comments on commit 781f57d

Please sign in to comment.