Skip to content

Commit 5091f82

Browse files
test to see if we signed in during xcodebuild archive/export
1 parent 7765041 commit 5091f82

7 files changed

Lines changed: 52 additions & 19 deletions

File tree

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57748,6 +57748,8 @@ async function UpdateTestDetails(project, whatsNew) {
5774857748
function normalizeVersion(version) {
5774957749
return version.split('.').map(part => parseInt(part, 10).toString()).join('.');
5775057750
}
57751+
async function downloadCertificate(project) {
57752+
}
5775157753

5775257754

5775357755
/***/ }),

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sign-app-bundle.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
#!/bin/bash
2-
# This script is used to sign macOS app bundles with a specified entitlements file.
3-
# Usage: ./signing.sh <path_to_app_bundle> <path_to_entitlements_path>
4-
# Example: ./signing.sh /path/to/MyApp.app /path/to/entitlements.plist
2+
# This script is used to sign macOS app bundles with a specified entitlements file and signing identity.
3+
# Usage: ./signing.sh <path_to_app_bundle> <path_to_entitlements_path> "<signing_identity>"
4+
# Example: ./signing.sh /path/to/MyApp.app /path/to/entitlements.plist "Developer ID Application: Your Name (Team ID)"
55

66
APP_BUNDLE_PATH="$1"
77
ENTITLEMENTS_PATH="$2"
8+
SIGNING_IDENTITY="$3"
89

910
# remove any metadata from the app bundle
1011
xattr -cr "$APP_BUNDLE_PATH"
1112

12-
# get the signing identity that matches Developer ID Application
13-
SIGNING_IDENTITY=$(security find-identity -p codesigning -v | grep "Developer ID Application" | awk -F'"' '{print $2}' | head -n 1)
13+
# verify the app bundle
14+
if codesign --verify --verbose=2 "$APP_BUNDLE_PATH"; then
15+
echo "App bundle is already signed. No need to sign again."
16+
exit 0
17+
fi
18+
19+
if [ -z "$SIGNING_IDENTITY" ]; then
20+
# get the signing identity that matches Developer ID Application
21+
SIGNING_IDENTITY=$(security find-identity -p codesigning -v | grep "Developer ID Application" | awk -F'"' '{print $2}' | head -n 1)
22+
fi
23+
1424
if [ -z "$SIGNING_IDENTITY" ]; then
1525
echo "No 'Developer ID Application' signing identity found!"
1626
exit 1

dist/sign-app-pkg.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#!/bin/bash
22
# This script is meant to sign macOS .pkg files.
3-
# Usage: ./sign-app-pkg.sh <path_to_pkg>
4-
# Example: ./sign-app-pkg.sh /path/to/MyApp.pkg
3+
# Usage: ./sign-app-pkg.sh <path_to_pkg> "<signing_identity>"
4+
# Example: ./sign-app-pkg.sh /path/to/MyApp.pkg "Developer ID Installer: Your Name (Team ID)"
55

66
PKG_PATH="$1"
7+
SIGNING_IDENTITY="$2"
78

8-
# find the Developer ID Installer signing identity
9-
SIGNING_IDENTITY=$(security find-identity -v | grep "Developer ID Installer" | awk -F'"' '{print $2}' | head -n 1)
9+
if [ -z "$SIGNING_IDENTITY" ]; then
10+
# find the Developer ID Installer signing identity
11+
SIGNING_IDENTITY=$(security find-identity -v | grep "Developer ID Installer" | awk -F'"' '{print $2}' | head -n 1)
12+
fi
1013
if [ -z "$SIGNING_IDENTITY" ]; then
1114
echo "No 'Developer ID Installer' signing identity found!"
1215
exit 1

src/AppStoreConnectClient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,9 @@ export async function UpdateTestDetails(project: XcodeProject, whatsNew: string)
300300

301301
function normalizeVersion(version: string): string {
302302
return version.split('.').map(part => parseInt(part, 10).toString()).join('.');
303+
}
304+
305+
// https://developer.apple.com/documentation/appstoreconnectapi/list_and_download_certificates
306+
async function downloadCertificate(project: XcodeProject): Promise<void> {
307+
// downloads the certificate from App Store Connect into the temp runner directory and adds it to the keychain created in AppleCredential.ts
303308
}

src/sign-app-bundle.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
#!/bin/bash
2-
# This script is used to sign macOS app bundles with a specified entitlements file.
3-
# Usage: ./signing.sh <path_to_app_bundle> <path_to_entitlements_path>
4-
# Example: ./signing.sh /path/to/MyApp.app /path/to/entitlements.plist
2+
# This script is used to sign macOS app bundles with a specified entitlements file and signing identity.
3+
# Usage: ./signing.sh <path_to_app_bundle> <path_to_entitlements_path> "<signing_identity>"
4+
# Example: ./signing.sh /path/to/MyApp.app /path/to/entitlements.plist "Developer ID Application: Your Name (Team ID)"
55

66
APP_BUNDLE_PATH="$1"
77
ENTITLEMENTS_PATH="$2"
8+
SIGNING_IDENTITY="$3"
89

910
# remove any metadata from the app bundle
1011
xattr -cr "$APP_BUNDLE_PATH"
1112

12-
# get the signing identity that matches Developer ID Application
13-
SIGNING_IDENTITY=$(security find-identity -p codesigning -v | grep "Developer ID Application" | awk -F'"' '{print $2}' | head -n 1)
13+
# verify the app bundle
14+
if codesign --verify --verbose=2 "$APP_BUNDLE_PATH"; then
15+
echo "App bundle is already signed. No need to sign again."
16+
exit 0
17+
fi
18+
19+
if [ -z "$SIGNING_IDENTITY" ]; then
20+
# get the signing identity that matches Developer ID Application
21+
SIGNING_IDENTITY=$(security find-identity -p codesigning -v | grep "Developer ID Application" | awk -F'"' '{print $2}' | head -n 1)
22+
fi
23+
1424
if [ -z "$SIGNING_IDENTITY" ]; then
1525
echo "No 'Developer ID Application' signing identity found!"
1626
exit 1

src/sign-app-pkg.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#!/bin/bash
22
# This script is meant to sign macOS .pkg files.
3-
# Usage: ./sign-app-pkg.sh <path_to_pkg>
4-
# Example: ./sign-app-pkg.sh /path/to/MyApp.pkg
3+
# Usage: ./sign-app-pkg.sh <path_to_pkg> "<signing_identity>"
4+
# Example: ./sign-app-pkg.sh /path/to/MyApp.pkg "Developer ID Installer: Your Name (Team ID)"
55

66
PKG_PATH="$1"
7+
SIGNING_IDENTITY="$2"
78

8-
# find the Developer ID Installer signing identity
9-
SIGNING_IDENTITY=$(security find-identity -v | grep "Developer ID Installer" | awk -F'"' '{print $2}' | head -n 1)
9+
if [ -z "$SIGNING_IDENTITY" ]; then
10+
# find the Developer ID Installer signing identity
11+
SIGNING_IDENTITY=$(security find-identity -v | grep "Developer ID Installer" | awk -F'"' '{print $2}' | head -n 1)
12+
fi
1013
if [ -z "$SIGNING_IDENTITY" ]; then
1114
echo "No 'Developer ID Installer' signing identity found!"
1215
exit 1

0 commit comments

Comments
 (0)