summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-07-14 21:31:21 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-07-14 21:31:21 +0200
commitd9131ae8c78519e6c8e17285ae29caa06e704892 (patch)
tree891cf6e0c0934b68779a1be5d96e6949ed03fcd5
parent10644a698c8a42232cb53a4372e3a09857fba0be (diff)
[pkg] add stub for stapler script
-rw-r--r--branding/scripts/osx-stapler.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/branding/scripts/osx-stapler.sh b/branding/scripts/osx-stapler.sh
new file mode 100644
index 0000000..3069e49
--- /dev/null
+++ b/branding/scripts/osx-stapler.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Notes to script notarization steps.
+# Taken from https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38
+
+# TODO: put pass in keychain
+
+# 1. create dmb
+hdiutil create -format UDZO -srcfolder yourFolder YourApp.dmg
+
+# 2. send notarization request
+requestInfo=$(xcrun altool --notarize-app \
+ --file "YourApp.dmg" \
+ --username "yourDeveloperAccountEmail@email.com" \
+ --password "@keychain:notarization-password" \
+ --asc-provider "yourAppleTeamID" \
+ --primary-bundle-id "com.your.app.bundle.id")
+
+current_status = "in progress"
+
+while [[ "$currentStatus" == "in progress" ]]; do
+
+sleep 15
+
+statusResponse=$(xcrun altool --notarization-info "$uuid" \
+ --username "yourDeveloperAccountEmail@email.com" \
+ --password "@keychain:notarization-password")
+
+# 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
+
+if [[ "$current_status" == "success" ]]; then
+ # staple notarization here
+ xcrun stapler staple "YourApp.dmg"
+else
+ echo "Error! The status was $current_status. There were errors. Please check the LogFileURL for error descriptions"
+ exit 1
+fi