Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate OSX building and Notarization in CI Builds #1114

Merged
merged 6 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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