Skip to content

Commit

Permalink
Move APPLE_TEAM_ID into secrets and include my certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Jan 8, 2025
1 parent 640a6a8 commit a0932ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ jobs:
run: |
USER=${{ secrets.APPLE_USERNAME }}; if [ -z "$USER" ]; then USER=""; fi
PW=${{ secrets.APPLE_PASSWORD }}; if [ -z "$PW" ]; then PW=""; fi
bash ./build/ci/macos/notarize.sh -u $USER -p $PW
TID=${{ secrets.APPLE_TEAM_ID }}; if [ -z "$TID" ]; then TID=""; fi
bash ./build/ci/macos/notarize.sh -u $USER -p $PW -t $TID
- name: Checksum
run: |
bash ./build/ci/tools/checksum.sh
Expand Down
7 changes: 4 additions & 3 deletions build/ci/macos/notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ trap 'echo Notarize failed; exit 1' ERR
ARTIFACTS_DIR="build.artifacts"
APPLE_USERNAME=""
APPLE_PASSWORD=""

# This information is public and can be extracted by anyone from the final .app file
APPLE_TEAM_ID="9QTZUZM4J9"
APPLE_TEAM_ID=""

while [[ "$#" -gt 0 ]]; do
case $1 in
-u|--user) APPLE_USERNAME="$2"; shift ;;
-p|--password) APPLE_PASSWORD="$2"; shift ;;
-t|--team) APPLE_TEAM_ID="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

if [ -z "$APPLE_USERNAME" ]; then echo "error: not set APPLE_USERNAME"; exit 1; fi
if [ -z "$APPLE_PASSWORD" ]; then echo "error: not set APPLE_PASSWORD"; exit 1; fi
if [ -z "$APPLE_TEAM_ID" ]; then echo "error: not set APPLE_TEAM_ID"; exit 1; fi

echo "APPLE_USERNAME: $APPLE_USERNAME"
echo "APPLE_PASSWORD: $APPLE_PASSWORD"
echo "APPLE_TEAM_ID: $APPLE_TEAM_ID"

ARTIFACT_NAME="$(cat $ARTIFACTS_DIR/env/artifact_name.env)"
echo "ARTIFACT_NAME: $ARTIFACT_NAME"
Expand Down
Binary file modified build/ci/macos/resources/mac_musescore.p12.enc
Binary file not shown.
5 changes: 1 addition & 4 deletions build/package_mac
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ do
done

otool -L ${VOLUME}/${APPNAME}.app/Contents/MacOS/mscore
otool -L ${VOLUME}/${APPNAME}.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess

echo "Rename ${APPNAME}.app to ${VOLUME}/${LONGER_NAME}.app"
mv ${VOLUME}/${APPNAME}.app "${VOLUME}/${LONGER_NAME}.app"
Expand Down Expand Up @@ -195,9 +194,7 @@ echo "Codesign"
# `codesign --deep` doesn't seem to search for code in Contents/Resources directory so sign libraries in it manually
find "${VOLUME}/${LONGER_NAME}.app/Contents/Resources" -name '*.dylib' -exec codesign --force --options runtime --deep -s "Developer ID Application: MuseScore" '{}' ';'
# Sign code in other (more conventional) locations
codesign --force --options runtime --entitlements "${WORKING_DIRECTORY}/../build/macosx_entitlements.plist" --deep -s "Developer ID Application: MuseScore" "${CODE_PATHS[@]}"
# Sign QtWebEngine application for MacOS Catalina
codesign --force --verify --verbose --options runtime --entitlements "${WORKING_DIRECTORY}/../build/qtwebengineprocess.entitlements" --deep --sign "Developer ID Application: MuseScore" "${VOLUME}/${LONGER_NAME}.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess"
codesign --force --options runtime --entitlements "${WORKING_DIRECTORY}/../build/macosx_entitlements.plist" --deep -s "Developer ID Application: Joachim Schmitz" "${CODE_PATHS[@]}"
echo "spctl"
spctl --assess --type execute "${VOLUME}/${LONGER_NAME}.app"
echo "Codesign verify"
Expand Down

0 comments on commit a0932ec

Please sign in to comment.