Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions .github/actions/build-macos-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ inputs:
description: Whether to sign and notarize the binaries
default: "true"
required: false
apple-application-certificate:
description: Apple Developer ID Application Certificate (PEM)
apple-application-p12:
description: Apple Developer ID Application Certificate + Private Key (base64-encoded P12)
required: false
apple-application-private-key:
description: Apple Developer ID Application Private Key (PEM)
apple-application-p12-password:
description: Password for the Apple Developer ID Application P12
required: false
apple-installer-certificate:
description: Apple Developer ID Installer Certificate (PEM)
apple-installer-p12:
description: Apple Developer ID Installer Certificate + Private Key (base64-encoded P12)
required: false
apple-installer-private-key:
description: Apple Developer ID Installer Private Key (PEM)
apple-installer-p12-password:
description: Password for the Apple Developer ID Installer P12
required: false
apple-api-key:
description: Apple App Store Connect API Key (JSON)
Expand Down Expand Up @@ -85,31 +85,33 @@ runs:
# Secrets are only materialized inside the protected environment. This step
# is skipped on the unsigned path, so secrets.* expressions in the calling
# workflow never expand into this runner.
#
# Only the P12 files (which are already encrypted at rest by their password)
# are written to disk. The P12 passwords are kept in the environment for the
# signing/notarization steps and are never written to a file.
- name: Write credentials
if: inputs.should-sign == 'true'
shell: bash
env:
APPLE_APP_STORE_CONNECT_API_DATA: ${{ inputs.apple-api-key }}
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE: ${{ inputs.apple-application-certificate }}
APPLE_DEVELOPER_ID_APPLICATION_PRIVATE_KEY: ${{ inputs.apple-application-private-key }}
APPLE_DEVELOPER_ID_INSTALLER_CERTIFICATE: ${{ inputs.apple-installer-certificate }}
APPLE_DEVELOPER_ID_INSTALLER_PRIVATE_KEY: ${{ inputs.apple-installer-private-key }}
APPLE_DEVELOPER_ID_APPLICATION_P12: ${{ inputs.apple-application-p12 }}
APPLE_DEVELOPER_ID_INSTALLER_P12: ${{ inputs.apple-installer-p12 }}
run: |-
echo "$APPLE_APP_STORE_CONNECT_API_DATA" > /tmp/app-store-connect.json
echo "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE" > /tmp/certificate-application.pem
echo "$APPLE_DEVELOPER_ID_APPLICATION_PRIVATE_KEY" > /tmp/private-key-application.pem
echo "$APPLE_DEVELOPER_ID_INSTALLER_CERTIFICATE" > /tmp/certificate-installer.pem
echo "$APPLE_DEVELOPER_ID_INSTALLER_PRIVATE_KEY" > /tmp/private-key-installer.pem
echo "$APPLE_DEVELOPER_ID_APPLICATION_P12" | base64 -d > /tmp/certificate-application.p12
echo "$APPLE_DEVELOPER_ID_INSTALLER_P12" | base64 -d > /tmp/certificate-installer.p12

# https://developer.apple.com/documentation/security/hardened_runtime
- name: Sign binaries
if: inputs.should-sign == 'true'
shell: bash
env:
RCODESIGN_P12_PASSWORD: ${{ inputs.apple-application-p12-password }}
run: |-
for f in bin/*; do
rcodesign sign -vv \
--pem-source /tmp/certificate-application.pem \
--pem-source /tmp/private-key-application.pem \
--p12-file /tmp/certificate-application.p12 \
--p12-password "$RCODESIGN_P12_PASSWORD" \
--code-signature-flags runtime \
"$f"
done
Expand Down Expand Up @@ -193,10 +195,12 @@ runs:
- name: Sign PKG
if: inputs.should-sign == 'true'
shell: bash
env:
RCODESIGN_P12_PASSWORD: ${{ inputs.apple-installer-p12-password }}
run: >-
rcodesign sign -vv
--pem-source /tmp/certificate-installer.pem
--pem-source /tmp/private-key-installer.pem
--p12-file /tmp/certificate-installer.p12
--p12-password "$RCODESIGN_P12_PASSWORD"
"staged/${{ steps.pkg.outputs.path }}"
"signed/${{ steps.pkg.outputs.path }}"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ jobs:
app-name: ${{ env.APP_NAME }}
python-version: ${{ env.PYTHON_VERSION }}
pyoxidizer-version: ${{ env.PYOXIDIZER_VERSION }}
apple-application-certificate: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE }}
apple-application-private-key: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_PRIVATE_KEY }}
apple-installer-certificate: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER_CERTIFICATE }}
apple-installer-private-key: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER_PRIVATE_KEY }}
apple-application-p12: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_P12 }}
apple-application-p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_P12_PASSWORD }}
apple-installer-p12: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER_P12 }}
apple-installer-p12-password: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER_P12_PASSWORD }}
apple-api-key: ${{ secrets.APPLE_APP_STORE_CONNECT_API_DATA }}

macos-packaging-unsigned:
Expand Down
Loading