Skip to content

Commit 82dbd72

Browse files
committed
ci: migrate notarization to notarytool
1 parent 6130a05 commit 82dbd72

File tree

1 file changed

+35
-25
lines changed

1 file changed

+35
-25
lines changed

.github/actions/agent-package-mac/action.yml

+35-25
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
with:
2121
p12-file-base64: ${{ inputs.p12-file-base64 }}
2222
p12-password: ${{ inputs.p12-password }}
23-
23+
2424
- name: Mac deploy Qt
2525
shell: sh
2626
run: |
@@ -82,38 +82,48 @@ runs:
8282
pkgutil --expand ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-product.pkg ./output/klogg_product_pkg
8383
pkgutil --flatten ./output/klogg_product_pkg ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-flatten.pkg
8484
productsign --sign "${{ env.KLOGG_INSTALLERSIGN }}" --timestamp ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-flatten.pkg ./packages/${{ env.KLOGG_PKG }}
85+
86+
- name: Prepare Notarization Credentials
87+
run: |
88+
# create temporary keychain
89+
KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
90+
KEYCHAIN_PASS=$(uuidgen)
91+
security create-keychain -p "${KEYCHAIN_PASS}" ${KEYCHAIN_PATH}
92+
security set-keychain-settings -lut 900 ${KEYCHAIN_PATH}
93+
security unlock-keychain -p "${KEYCHAIN_PASS}" ${KEYCHAIN_PATH}
94+
# import credentials from secrets
95+
xcrun notarytool store-credentials notarization --apple-id "${{ inputs.appstore-connect-username }}" --password "${{ inputs.appstore-connect-password }}" --keychain "${KEYCHAIN_PATH}"
96+
shell: bash
8597

86-
- name: "Mac notarize DMG"
98+
- name: Mac notarize DMG
8799
if: ${{ github.event_name != 'pull_request' }}
88-
uses: BoundfoxStudios/action-xcode-notarize@v1
89-
with:
90-
verbose: true
91-
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}"
92-
primary-bundle-id: "dev.filimonov.klogg"
93-
appstore-connect-username: ${{ inputs.appstore-connect-username }}
94-
appstore-connect-password: ${{ inputs.appstore-connect-password }}
100+
run: |
101+
KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
102+
xcrun notarytool submit "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}" --keychain-profile "notarize" --keychain "${KEYCHAIN_PATH}" --wait
103+
shell: bash
95104

96-
- name: "Mac staple DMG"
105+
- name: Mac staple DMG
97106
if: ${{ github.event_name != 'pull_request' }}
98-
uses: BoundfoxStudios/action-xcode-staple@v1
99-
with:
100-
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}"
107+
run: xcrun stapler staple "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}"
108+
shell: bash
101109

102-
- name: "Mac notarize PKG"
110+
- name: Mac notarize PKG
103111
if: ${{ github.event_name != 'pull_request' }}
104-
uses: BoundfoxStudios/action-xcode-notarize@v1
105-
with:
106-
verbose: true
107-
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}"
108-
primary-bundle-id: "dev.filimonov.klogg"
109-
appstore-connect-username: ${{ inputs.appstore-connect-username }}
110-
appstore-connect-password: ${{ inputs.appstore-connect-password }}
112+
run: |
113+
KEYCHAIN_PATH=$RUNNER_TEMP/notarization.keychain-db
114+
xcrun notarytool submit "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}" --keychain-profile "notarize" --keychain "${KEYCHAIN_PATH}" --wait
115+
shell: bash
111116

112-
- name: "Mac staple PKG"
117+
- name: Mac staple PKG
113118
if: ${{ github.event_name != 'pull_request' }}
114-
uses: BoundfoxStudios/action-xcode-staple@v1
115-
with:
116-
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}"
119+
run: xcrun stapler staple "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}"
120+
shell: bash
121+
122+
- name: Cleanup Notarization
123+
if: ${{ always() }}
124+
run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db
125+
shell: bash
126+
continue-on-error: true
117127

118128
- name: Mac symbols
119129
shell: sh

0 commit comments

Comments
 (0)