mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
GHA MacOS Only Sign/Notarize if self repo
This commit is contained in:
parent
59ca4397e2
commit
03491c11df
1 changed files with 39 additions and 30 deletions
9
.github/workflows/desktop-build.yml
vendored
9
.github/workflows/desktop-build.yml
vendored
|
|
@ -270,6 +270,8 @@ jobs:
|
||||||
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
|
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
|
||||||
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
|
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n "$MACOS_CERTIFICATE_NAME" ]]
|
||||||
|
then
|
||||||
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
||||||
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
security default-keychain -s build.keychain
|
security default-keychain -s build.keychain
|
||||||
|
|
@ -277,6 +279,7 @@ jobs:
|
||||||
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
||||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
fi
|
||||||
.ci/compile.sh --server --parallel ${{matrix.core_count}}
|
.ci/compile.sh --server --parallel ${{matrix.core_count}}
|
||||||
|
|
||||||
- name: Sign app bundle
|
- name: Sign app bundle
|
||||||
|
|
@ -285,8 +288,11 @@ jobs:
|
||||||
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
||||||
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n "$MACOS_CERTIFICATE_NAME" ]]
|
||||||
|
then
|
||||||
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
/usr/bin/codesign --sign="$MACOS_CERTIFICATE_NAME" --entitlements=".ci/macos.entitlements" --options=runtime --force --deep --timestamp --verbose ${{steps.build.outputs.path}}
|
/usr/bin/codesign --sign="$MACOS_CERTIFICATE_NAME" --entitlements=".ci/macos.entitlements" --options=runtime --force --deep --timestamp --verbose ${{steps.build.outputs.path}}
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Notarize app bundle
|
- name: Notarize app bundle
|
||||||
if: matrix.make_package
|
if: matrix.make_package
|
||||||
|
|
@ -295,6 +301,8 @@ jobs:
|
||||||
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
|
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
|
||||||
MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
|
MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n "$MACOS_NOTARIZATION_APPLE_ID" ]]
|
||||||
|
then
|
||||||
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
|
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
|
||||||
echo "Create keychain profile"
|
echo "Create keychain profile"
|
||||||
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
|
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
|
||||||
|
|
@ -316,6 +324,7 @@ jobs:
|
||||||
# validated by macOS even when an internet connection is not available.
|
# validated by macOS even when an internet connection is not available.
|
||||||
echo "Attach staple"
|
echo "Attach staple"
|
||||||
xcrun stapler staple ${{steps.build.outputs.path}}
|
xcrun stapler staple ${{steps.build.outputs.path}}
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: matrix.make_package
|
if: matrix.make_package
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue