Skip to content

Commit

Permalink
Merge pull request #1114 from Dyalog/notarize
Browse files Browse the repository at this point in the history
Separate OSX building and Notarization in CI Builds
  • Loading branch information
dyaandys authored Aug 30, 2023
2 parents c7b42b4 + ea4d2b4 commit cd42f43
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
24 changes: 23 additions & 1 deletion CI/packagescripts/osx/notarise.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

APPLE_TEAM="6LKE87V3BD"

# functions for notarising a file

notarizefile() { # $1: path to file to notarize
Expand Down Expand Up @@ -33,4 +36,23 @@ notarizefile() { # $1: path to file to notarize
exit 1
fi

}
}

## This should be moved to a common script called by both notarise and package.

APPNAME=$(node -e "console.log($(cat package.json).productName)") # "Ride-4.0" or similar
SHIPDIRECTORY=ship
if [ -s _/version ]; then
RIDEVERSION=`cat _/version`
else
RIDEVERSION=9.9.9
fi
REVISION_VERSION=`echo $RIDEVERSION | sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
ARCHIVENAME=`echo "${SHIPDIRECTORY}/${APPNAME}.${REVISION_VERSION}_mac.pkg" | tr '[:upper:]' '[:lower:]'`

# upload for notarization
notarizefile "$ARCHIVENAME"

# staple result
echo "## Stapling $ARCHIVENAME"
/usr/bin/xcrun stapler staple "$ARCHIVENAME"
7 changes: 0 additions & 7 deletions CI/packagescripts/osx/packageOSX.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
source "$(dirname "$0")/notarise.sh"
set -x -e -o pipefail

# The following variables must be set prior to invoking this script
Expand Down Expand Up @@ -78,11 +77,5 @@ ARCHIVENAME=`echo "${SHIPDIRECTORY}/${APPNAME}.${REVISION_VERSION}_mac.pkg" | tr
--sign "$APPLE_CERT_INSTALLER" \
"$ARCHIVENAME"

# upload for notarization
notarizefile "$ARCHIVENAME"

# staple result
echo "## Stapling $ARCHIVENAME"
/usr/bin/xcrun stapler staple "$ARCHIVENAME"

echo '## Done!'
22 changes: 21 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pipeline {
}
stage ('Mac Build and Packaging') {
agent {
label 'Mac && x86 && Build && notarytool'
label 'Mac && x86 && Build'
}
steps {
sh 'rm -Rf _ ship'
Expand Down Expand Up @@ -80,6 +80,26 @@ pipeline {
}
}
}
stage ('OSX Notorise') {
agent {
label 'notarytool'
}
steps {
sh 'rm -Rf ship'
sh 'rm -Rf _'
unstash 'ride-version'
unstash 'mac-ship'
withCredentials([usernamePassword(credentialsId: '868dda6c-aaec-4ee4-845a-57362dec695b', passwordVariable: 'APPLE_APP_PASS', usernameVariable: 'APPLE_ID')]) {
sh "CI/packagescripts/osx/notarise.sh"
}
stash name: 'mac-ship', includes: 'ship/*'
}
when {
not {
branch 'PR-*'
}
}
}
stage ('Copy install images') {
agent {
docker {
Expand Down

0 comments on commit cd42f43

Please sign in to comment.