Skip to content
Snippets Groups Projects
Unverified Commit 8fd0fcc5 authored by Kali Kaneko's avatar Kali Kaneko Committed by Kali Kaneko
Browse files

[pkg] improve stapler script

parent d9131ae8
No related branches found
No related tags found
No related merge requests found
...@@ -253,6 +253,11 @@ ifeq (${PLATFORM}, darwin) ...@@ -253,6 +253,11 @@ ifeq (${PLATFORM}, darwin)
ditto -ck --rsrc --sequesterRsrc build/installer/${APPNAME}-installer-${VERSION}.app build/installer/${APPNAME}-installer-${VERSION}.zip ditto -ck --rsrc --sequesterRsrc build/installer/${APPNAME}-installer-${VERSION}.app build/installer/${APPNAME}-installer-${VERSION}.zip
endif endif
notarize_all:
APPNAME=${APPNAME} VERSION=${VERSION} TARGET=${TARGET} OSXAPPPASS=${OSXAPPPASS} branding/scripts/osx-stapler.sh
# --------------------
notarize_installer: notarize_installer:
# courtesy of https://skyronic.com/2019/07/app-notarization-for-qt-applications/ # courtesy of https://skyronic.com/2019/07/app-notarization-for-qt-applications/
ifeq (${PLATFORM}, darwin) ifeq (${PLATFORM}, darwin)
...@@ -274,6 +279,8 @@ ifeq (${PLATFORM}, darwin) ...@@ -274,6 +279,8 @@ ifeq (${PLATFORM}, darwin)
@create-dmg deploy/${APPNAME}-${VERSION}.dmg build/installer/${APPNAME}-installer-${VERSION}.app @create-dmg deploy/${APPNAME}-${VERSION}.dmg build/installer/${APPNAME}-installer-${VERSION}.app
endif endif
# --------------------
check_qtifw: check_qtifw:
ifdef HAS_QTIFW ifdef HAS_QTIFW
... ...
......
#!/usr/bin/env python3
import sys
arg = sys.argv[1]
line = [x for x in arg.split('\n') if x.startswith('Status:')]
print(line[0].split('Status: ')[-1])
#!/usr/bin/env python3
import sys
arg = sys.argv[1]
line = [x for x in arg.split('\n') if x.startswith('Status:')]
print(line[0].split('=')[1])
#!/bin/bash #!/bin/bash
# Notes to script notarization steps. # Notes to script notarization steps.
# To be called from the root folder.
# Taken from https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38 # Taken from https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38
# TODO: put pass in keychain # TODO: put pass in keychain
# --password "@keychain:notarization-password"
# 1. create dmb USER=info@leap.se
hdiutil create -format UDZO -srcfolder yourFolder YourApp.dmg
# 2. send notarization request
requestInfo=$(xcrun altool --notarize-app \ requestInfo=$(xcrun altool --notarize-app \
--file "YourApp.dmg" \ -t osx -f build/installer/${APPNAME}-installer-${VERSION}.zip \
--username "yourDeveloperAccountEmail@email.com" \ --primary-bundle-id="se.leap.bitmask.${TARGET}" \
--password "@keychain:notarization-password" \ -u ${USER} \
--asc-provider "yourAppleTeamID" \ -p ${OSXAPPPASS})
--primary-bundle-id "com.your.app.bundle.id")
uuid=$(python branding/scripts/osx-get-uuid.py $requestInfo)
current_status = "in progress" current_status = "in progress"
...@@ -22,31 +23,16 @@ while [[ "$currentStatus" == "in progress" ]]; do ...@@ -22,31 +23,16 @@ while [[ "$currentStatus" == "in progress" ]]; do
sleep 15 sleep 15
statusResponse=$(xcrun altool --notarization-info "$uuid" \ statusResponse=$(xcrun altool --notarization-info "$uuid" \
--username "yourDeveloperAccountEmail@email.com" \ --username ${USER} \
--password "@keychain:notarization-password") --password ${OSXAPPPASS})
current_status=$(python branding/scripts/osx-get-status.py $statusResponse)
# TODO change to python ---- ruby script ------------------------------------
# the response is a multiline string, with the status being on its own line
# using the format "Status: <status here>"
# Split each line into its own object in an array
response_objects = ARGV[0].split("\n")
# get line that contains the "Status:" text
status_line = response_objects.select { |data| data.include?('Status:') }[0]
# get text describing the status (should be either "in progress" or "success")
current_status = "#{status_line.split('Status: ').last}"
# respond with value
puts current_status
# -- end ruby script --------------------------------------------------------
current_status=$(ruby status.rb "$statusResponse")
done done
if [[ "$current_status" == "success" ]]; then if [[ "$current_status" == "success" ]]; then
# staple notarization here # staple notarization here
xcrun stapler staple "YourApp.dmg" xcrun stapler staple build/installer/${APPNAME}-installer-${VERSION}.app
create-dmg deploy/${APPNAME}-${VERSION}.dmg build/installer/${APPNAME}-installer-${VERSION}.app
else else
echo "Error! The status was $current_status. There were errors. Please check the LogFileURL for error descriptions" echo "Error! The status was $current_status. There were errors. Please check the LogFileURL for error descriptions"
exit 1 exit 1
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment