File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,12 @@ jobs:
96
96
fetch-depth : 0
97
97
98
98
- name : import and trust codesigning cert for macOS
99
- if : startsWith(matrix.os, 'macos') && (github.ref_name == 'main' || github.ref_type == 'tag')
99
+ if : startsWith(matrix.os, 'macos') # && (github.ref_name == 'main' || github.ref_type == 'tag')
100
100
shell : bash
101
101
run : ./.github/workflows/import_cert.sh
102
102
env :
103
- MAC_CERTS_PASSWORD : ${{ secrets.mac_certs_password }}
104
- MAC_KEY : ${{ secrets.mac_certs }}
103
+ MAC_KEY_PASSWORD : ${{ secrets.mac_key_password }}
104
+ MAC_KEY : ${{ secrets.mac_key }}
105
105
MAC_CERT : ${{ secrets.mac_cert }}
106
106
107
107
# Build server
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
echo " Creating new keychain"
3
3
4
- security create-keychain -p " $MAC_CERTS_PASSWORD " build.keychain
4
+ security create-keychain -p " $MAC_KEY_PASSWORD " build.keychain
5
5
security default-keychain -s build.keychain
6
- security unlock-keychain -p " $MAC_CERTS_PASSWORD " build.keychain
6
+ security unlock-keychain -p " $MAC_KEY_PASSWORD " build.keychain
7
7
8
8
echo " Importing key"
9
- security import <( echo $MAC_KEY | base64 -d) -P " $MAC_CERTS_PASSWORD " -f pkcs12
9
+ security import <( echo $MAC_KEY | base64 -d) -P " $MAC_KEY_PASSWORD " -f pkcs12
10
10
11
11
echo " Trusting Certificate"
12
12
# Using sudo because overwriting trust settings would require interactive password input
13
13
echo $MAC_CERT | base64 -d > cert.cer
14
14
sudo security authorizationdb write com.apple.trust-settings.admin allow
15
15
sudo security add-trusted-cert -d -r trustRoot -p codeSign -k build.keychain cert.cer
16
16
sudo security authorizationdb remove com.apple.trust-settings.admin
17
+
18
+ n_valid_certs=` security find-identity -v -p codesigning | grep ' valid identities found' | awk ' { print $1 }' `
19
+
20
+ if [ $n_valid_certs -lt 1 ]; then
21
+ echo " Error, no valid codesigning certificate found"
22
+ security find-identity -p codesigning
23
+ exit 1
24
+ fi
You can’t perform that action at this time.
0 commit comments