-
Notifications
You must be signed in to change notification settings - Fork 276
macOS Code Signing and Notarization #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ea78f8d
918343e
5cbeb9a
b982760
fb34cc2
b4827b4
c509705
bfdf9f8
b893489
be9e6fa
301380c
7dd02a4
6da8ddd
c1a84a3
e1e8da4
3a4ac89
8d00e9f
c4b20fe
52724da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,25 @@ | ||
| name: Descent 3 Build | ||
|
|
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '**/*.md' | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '**/README.md' | ||
| - '**/LICENSE' | ||
| workflow_call: | ||
| secrets: | ||
| MACOS_SIGNING_IDENTITY: | ||
| required: false | ||
| MACOS_SIGNING_CERTIFICATE_P12: | ||
| required: false | ||
| MACOS_SIGNING_CERTIFICATE_P12_PASSWORD: | ||
| required: false | ||
| MACOS_APP_STORE_CONNECT_KEY: | ||
| required: false | ||
| MACOS_APP_STORE_CONNECT_KEY_ID: | ||
| required: false | ||
| MACOS_APP_STORE_CONNECT_ISSUER_ID: | ||
| required: false | ||
|
|
||
|
|
||
| jobs: | ||
|
|
||
tophyr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| build: | ||
| name: ${{ matrix.os.name }}, ${{ matrix.build_type }} | ||
| strategy: | ||
|
|
@@ -50,6 +57,9 @@ jobs: | |
|
|
||
| runs-on: ${{ matrix.os.runner }} | ||
|
|
||
| env: | ||
| MACOS_AND_CODE_SIGNING: ${{ matrix.os.preset == 'mac' && secrets.MACOS_SIGNING_IDENTITY != '' }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
|
|
@@ -103,12 +113,19 @@ jobs: | |
| cp ./arm64-osx.cmake ./community/universal-osx.cmake | ||
| sed -i '' 's/^set(VCPKG_OSX_ARCHITECTURES.*$/set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64")/' ./community/universal-osx.cmake | ||
|
|
||
| - name: Import macOS code signing certificate | ||
| if: ${{ env.MACOS_AND_CODE_SIGNING == 'true' }} | ||
| uses: DescentDevelopers/import-codesign-certs@v1 | ||
| with: | ||
| p12-file-base64: ${{ secrets.MACOS_SIGNING_CERTIFICATE_P12 }} | ||
| p12-password: ${{ secrets.MACOS_SIGNING_CERTIFICATE_P12_PASSWORD }} | ||
|
|
||
| - name: Configure CMake | ||
| if: ${{ matrix.os.preset != 'linux-cross-arm64' }} | ||
| env: | ||
| CC: ${{ matrix.os.cc }} | ||
| CXX: ${{ matrix.os.cxx }} | ||
| run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON -DUSE_EXTERNAL_PLOG=ON | ||
| run: cmake --preset ${{ matrix.os.preset }} -DCODESIGN_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON -DUSE_EXTERNAL_PLOG=ON | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. CMake isn't my forte, so let me know if I can do this better.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oooo, maybe not fixed. In fact, the build is failing. Sad.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried futzing with it but couldn't get it working. I'll try again tomorrow.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll look into it tonight and try to help you out
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see suggestions below
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the help! Fixed. |
||
|
|
||
| - name: Build ${{ matrix.build_type }} | ||
| run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose | ||
|
|
@@ -121,6 +138,25 @@ jobs: | |
| # There no cmake install presets so install in traditional way | ||
| run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }} | ||
|
|
||
| - name: Sign, package, and notarize for macOS | ||
| if: ${{ env.MACOS_AND_CODE_SIGNING == 'true' }} | ||
| uses: DescentDevelopers/macos-sign-package-notarize@v1 | ||
| with: | ||
| path-to-binaries: builds/${{ matrix.os.preset }}/installed/Descent3.app builds/${{ matrix.os.preset }}/installed/netgames/* | ||
| signing-identity: ${{ secrets.MACOS_SIGNING_IDENTITY }} | ||
| app-store-connect-key: ${{ secrets.MACOS_APP_STORE_CONNECT_KEY }} | ||
| app-store-connect-key-id: ${{ secrets.MACOS_APP_STORE_CONNECT_KEY_ID }} | ||
| app-store-connect-issuer-id: ${{ secrets.MACOS_APP_STORE_CONNECT_ISSUER_ID }} | ||
| archive-files: builds/${{ matrix.os.preset }}/installed/* | ||
| archive-disk-name: Descent 3 | ||
| archive-file-path: builds/${{ matrix.os.preset }}/Descent3-${{ matrix.build_type }}-${{ matrix.os.name }}.dmg | ||
|
|
||
| - name: Swap macOS DMG disk image into installed folder | ||
| if: ${{ env.MACOS_AND_CODE_SIGNING == 'true' }} | ||
| run: | | ||
| rm -rf builds/${{ matrix.os.preset }}/installed/* | ||
| mv builds/${{ matrix.os.preset }}/Descent3-${{ matrix.build_type }}-${{ matrix.os.name }}.dmg builds/${{ matrix.os.preset }}/installed/ | ||
|
|
||
| - name: Upload Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Continuous Delivery | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
Lgt2x marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| paths-ignore: | ||
| - '**/*.md' | ||
|
|
||
|
|
||
| jobs: | ||
|
|
||
| build: | ||
| name: Build for main branch | ||
| uses: ./.github/workflows/build.yml | ||
| secrets: | ||
| MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }} | ||
| MACOS_SIGNING_CERTIFICATE_P12: ${{ secrets.MACOS_SIGNING_CERTIFICATE_P12 }} | ||
| MACOS_SIGNING_CERTIFICATE_P12_PASSWORD: ${{ secrets.MACOS_SIGNING_CERTIFICATE_P12_PASSWORD }} | ||
| MACOS_APP_STORE_CONNECT_KEY: ${{ secrets.MACOS_APP_STORE_CONNECT_KEY }} | ||
| MACOS_APP_STORE_CONNECT_KEY_ID: ${{ secrets.MACOS_APP_STORE_CONNECT_KEY_ID }} | ||
| MACOS_APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.MACOS_APP_STORE_CONNECT_ISSUER_ID }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Continuous Integration | ||
|
|
||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths-ignore: | ||
| - '**/README.md' | ||
| - '**/LICENSE' | ||
|
|
||
|
|
||
| jobs: | ||
|
|
||
| build: | ||
| name: Build for PR | ||
| uses: ./.github/workflows/build.yml | ||
| # explicitly not passing secrets into the build | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double-checking: pull requests originating from outside the (is it even possible to submit a PR to yourself? suppose i could try that out, but kinda irrelevant either way)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do an actual live test of this tomorrow.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The live test was a success. I confirmed GitHub's documentation to be correct. A PR from a fork has no access to the secrets in the base repository. Even if the fork PR changes the GitHub Action and tries to reference the secrets and exfiltrate them, nothing is accessed. |
||
Uh oh!
There was an error while loading. Please reload this page.