Skip to content

Commit

Permalink
CI: Read codesign certificate from secret
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Nov 7, 2023
1 parent d28c5aa commit af322b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
SCCACHE_VERSION: "0.3.0"
# macOS codesigning
APPLE_CODESIGN_IDENTITY: 2C2B5D3EDCE82BA55E22E9A67F16F8D03E390870
MACOS_CODESIGN_OPENSSL_PASSWORD: ${{ secrets.MACOS_CODESIGN_OPENSSL_PASSWORD }}
MACOS_CODESIGN_P12_BASE64: ${{ secrets.MACOS_CODESIGN_P12_BASE64 }}
MACOS_CODESIGN_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CODESIGN_CERTIFICATE_PASSWORD }}

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -221,13 +221,10 @@ jobs:

- name: "[macOS] Import Apple code signing identity"
id: apple_codesign
if: runner.os == 'macOS' && env.MACOS_CODESIGN_OPENSSL_PASSWORD != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null
if: runner.os == 'macOS' && env.MACOS_CODESIGN_CERTIFICATE_P12_BASE64 != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null
run: |
# Decrypt the certificate
openssl enc -aes-256-cbc -d -md sha512 \
-k "${MACOS_CODESIGN_OPENSSL_PASSWORD}" \
-in "${{ github.workspace }}/packaging/certificates/macos_developer_id_codesign_certificate.p12.enc" \
-out ~/certificate.p12
# Decode the certificate
echo "${{ env.MACOS_CODESIGN_CERTIFICATE_P12_BASE64 }}" | base64 -d -o ~/certificate.p12
# Create a temporary keychain for the certificate and import it.
security create-keychain -p mixxx Mixxx.keychain
Expand Down Expand Up @@ -386,7 +383,7 @@ jobs:
working-directory: build

- name: "[macOS] Sign, Notarize, and Staple Package"
if: runner.os == 'macOS' && env.MACOS_CODESIGN_OPENSSL_PASSWORD != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null && env.APPLE_APP_SPECIFIC_PASSWORD != null
if: runner.os == 'macOS' && env.MACOS_CODESIGN_CERTIFICATE_P12_BASE64 != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null && env.APPLE_APP_SPECIFIC_PASSWORD != null
run: packaging/macos/sign_notarize_staple.sh build/*.dmg
# TODO: This timeout may be a bit too conservative under some
# circumstances. Feel free to increase the timeout once the
Expand Down
Binary file not shown.

0 comments on commit af322b1

Please sign in to comment.