Skip to content
Merged
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
23 changes: 9 additions & 14 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ timestamps {
}

stage ('Signing') {
def notarize_mac = true
def notarize_ios = true
def entitlements = "${workspace}/xamarin-macios/mac-entitlements.plist"
currentStage = "${STAGE_NAME}"
echo ("Building on ${env.NODE_NAME}")
Expand All @@ -503,28 +501,26 @@ timestamps {
if (bundleZip.length > 0)
bundleZipFilename = bundleZip [0].name

withCredentials ([string (credentialsId: 'codesign_keychain_pw', variable: 'PRODUCTSIGN_KEYCHAIN_PASSWORD')]) {
sh ("${workspace}/xamarin-macios/jenkins/productsign.sh")
}

if (notarize_mac || notarize_ios) {
if (isPr) {
withCredentials ([string (credentialsId: 'codesign_keychain_pw', variable: 'PRODUCTSIGN_KEYCHAIN_PASSWORD')]) {
sh ("${workspace}/xamarin-macios/jenkins/productsign.sh")
}
} else {
try {
pkgs = []
pkgs = xiPackages + xmPackages
if (fileExists('release-scripts')) {
dir('release-scripts') {
sh ('git checkout sign-and-notarized && git pull')
}
} else {
sh ('git clone git@github.com:xamarin/release-scripts -b sign-and-notarized')
}
if (notarize_mac)
pkgs = pkgs + xmPackages
if (notarize_ios)
pkgs = pkgs + xiPackages
withCredentials([string(credentialsId: 'codesign_keychain_pw', variable: 'KEYCHAIN_PASS'), string(credentialsId: 'team_id', variable: 'TEAM_ID'), string(credentialsId: 'application_id', variable: 'APP_ID'), string(credentialsId: 'installer_id', variable: 'INSTALL_ID'), usernamePassword(credentialsId: 'apple_account', passwordVariable: 'APPLE_PASS', usernameVariable: 'APPLE_ACCOUNT')]) {
sh (returnStatus: true, script: "security create-keychain -p ${env.KEYCHAIN_PASS} login.keychain") // needed to repopulate the keychain
sh ("security unlock-keychain -p ${env.KEYCHAIN_PASS} login.keychain")
sh ("python release-scripts/sign_and_notarize.py -a ${env.APP_ID} -i ${env.INSTALL_ID} -u ${env.APPLE_ACCOUNT} -p ${env.APPLE_PASS} -t ${env.TEAM_ID} -d package/notarized -e ${entitlements} -k login.keychain " + pkgs.flatten().join(" "))
timeout(time: 90, unit: 'MINUTES') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout(time: 90, unit: 'MINUTES') {
timeout (time: 90, unit: 'MINUTES') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other timeout calls do have the space, other methods no. But lets be consistent.

sh ("python release-scripts/sign_and_notarize.py -a ${env.APP_ID} -i ${env.INSTALL_ID} -u ${env.APPLE_ACCOUNT} -p ${env.APPLE_PASS} -t ${env.TEAM_ID} -d package/notarized -e ${entitlements} -k login.keychain " + pkgs.flatten ().join (" "))
}
}

def xiNotarizedPackages = findFiles (glob: "package/notarized/xamarin.ios-*.pkg")
Expand All @@ -543,7 +539,6 @@ timestamps {
echo "\t${stack}"
}
manager.addWarningBadge("PKGs are not notarized")

}
}
}
Expand Down