unify.sh (1867B)
1 #!/bin/sh 2 # This Source Code Form is subject to the terms of the Mozilla Public 3 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6 set -x -e 7 8 export LIPO=$MOZ_FETCHES_DIR/cctools/bin/x86_64-apple-darwin-lipo 9 10 for i in x64 aarch64; do 11 $GECKO_PATH/mach python -m mozbuild.action.unpack_dmg $MOZ_FETCHES_DIR/$i/target.dmg $i 12 done 13 $GECKO_PATH/mach python $GECKO_PATH/toolkit/mozapps/installer/unify.py x64/*.app aarch64/*.app 14 $GECKO_PATH/mach python -m mozbuild.action.make_dmg x64 target.dmg 15 16 mkdir -p $UPLOAD_DIR 17 mv target.dmg $UPLOAD_DIR/ 18 19 python3 -c ' 20 import json 21 import os 22 23 for artifact in json.loads(os.environ["MOZ_FETCHES"]): 24 if artifact.get("extract") and artifact.get("dest", "").startswith("x64"): 25 print(artifact["dest"], os.path.basename(artifact["artifact"])) 26 ' | while read dir artifact; do 27 if [ "$artifact" = target.crashreporter-symbols.zip ]; then 28 $GECKO_PATH/mach python $GECKO_PATH/python/mozbuild/mozbuild/action/unify_symbols.py $MOZ_FETCHES_DIR/$dir $MOZ_FETCHES_DIR/aarch64${dir#x64} 29 else 30 $GECKO_PATH/mach python $GECKO_PATH/python/mozbuild/mozbuild/action/unify_tests.py $MOZ_FETCHES_DIR/$dir $MOZ_FETCHES_DIR/aarch64${dir#x64} 31 fi 32 33 case $artifact in 34 *.tar.gz) 35 find $MOZ_FETCHES_DIR/$dir -not -type d -printf '%P\0' | tar -C $MOZ_FETCHES_DIR/$dir --owner=0:0 --group=0:0 -zcf $artifact --no-recursion --null -T - 36 ;; 37 *.tar.zst) 38 find $MOZ_FETCHES_DIR/$dir -not -type d -printf '%P\0' | tar -C $MOZ_FETCHES_DIR/$dir --owner=0:0 --group=0:0 --zstd -cf $artifact --no-recursion --null -T - 39 ;; 40 *.zip) 41 $GECKO_PATH/mach python $GECKO_PATH/python/mozbuild/mozbuild/action/zip.py -C $MOZ_FETCHES_DIR/$dir $PWD/$artifact '*' 42 ;; 43 esac 44 mv $artifact $UPLOAD_DIR/ 45 done