CI: Add check for code signing credentials used by notarization

This commit is contained in:
PatTheMav 2021-05-18 22:05:19 +02:00 committed by Jim
parent 924d9a7d9c
commit b24faf6b33

View file

@ -34,6 +34,7 @@ jobs:
SPARKLE_VERSION: '1.23.0'
QT_VERSION: '5.15.2'
SIGN_IDENTITY: ''
HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }}
steps:
- name: Get Current Arch
shell: bash
@ -167,13 +168,13 @@ jobs:
run: |
pip3 install dmgbuild
- name: 'Install Apple Developer Certificate'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true'
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
- name: 'Set Signing Identity'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true'
run: |
echo "SIGN_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }}" >> $GITHUB_ENV
- name: 'Create macOS application bundle'
@ -326,7 +327,7 @@ jobs:
name: '${{ env.FILE_NAME }}'
path: ./nightly/*.dmg
- name: 'Package Release'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true'
working-directory: ${{ github.workspace }}/build
shell: bash
run: |
@ -348,7 +349,7 @@ jobs:
mkdir ../release
sudo mv ./$FILE_NAME ../release/$RELEASE_FILE_NAME
- name: 'Publish Release'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && env.HAVE_CODESIGN_IDENTITY == 'true'
uses: actions/upload-artifact@v2.2.0
with:
name: '${{ env.RELEASE_FILE_NAME }}'