Skip to content

Commit 1d0f5ae

Browse files
committed
build: setup macos keychain [build]
1 parent b5462f4 commit 1d0f5ae

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,31 @@ jobs:
6767
name: guppy
6868
path: ./cli/dist/guppy
6969

70+
- name: Setup keychain
71+
env:
72+
CERTIFICATE_BASE64: ${{ secrets.DEVELOPER_ID_CERT }}
73+
CERTIFICATE_PASSWORD: ${{ secrets.DEVELOPER_ID_CERT_PWD }}
74+
run: |
75+
# create variables
76+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
77+
KEYCHAIN_PASSWORD: $(openssl rand -base64 32)
78+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
79+
80+
# import certificate and provisioning profile from secrets
81+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
82+
83+
# create temporary keychain
84+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
85+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
86+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
87+
88+
# import certificate to keychain
89+
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
90+
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
91+
security list-keychain -d user -s $KEYCHAIN_PATH
92+
7093
- name: Sign guppy binary
71-
run: codesign -s - ./cli/dist/guppy
94+
run: codesign -s "Developer ID Application" ./cli/dist/guppy
7295

7396
- name: Build macOS archive
7497
env:
@@ -93,7 +116,7 @@ jobs:
93116
- name: Notarize macOS installer
94117
run: |
95118
xcrun notarytool submit \
96-
--team-id '' \
119+
--team-id L8SL8KUNVD' \
97120
--apple-id ${{ secrets.NOTARY_USERNAME }} \
98121
--password ${{ secrets.NOTARY_PASSWORD }} \
99122
--wait \

0 commit comments

Comments
 (0)