Skip to content
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

Mac: Add automatic code signing and notarization #1805

Merged
merged 7 commits into from
Nov 17, 2020

Conversation

cwensley
Copy link
Member

@cwensley cwensley commented Oct 17, 2020

This adds the ability to create DMG's, code sign, and notarize your Eto.Mac64 apps automatically. This only works on a Mac.

New properties that control these features:

DMG Creation

    <!-- add to your csproj -->
    <EnableDmgBuild>True</EnableDmgBuild>

    <!-- File Name of the DMG -->
    <DmgName Condition="$(DmgName) == ''">$(MacBundleName)</DmgName>
    <!-- DMG volume name -->
    <DmgVolumeName Condition="$(DmgVolumeName) == ''">$(DmgName)</DmgVolumeName>
    <!-- Where to put the DMG -->
    <DmgOutputPath Condition="$(DmgOutputPath) == ''">$(OutputPath)</DmgOutputPath>

    <!-- True to add typical formatting to the DMG, add application shortcut icon, background, auto-open, etc. -->
    <DmgBeautify Condition="$(DmgBeautify) == ''">True</DmgBeautify>

    <!-- Size of the icons in the DMG -->
    <DmgIconSize Condition="$(DmgIconSize) == ''">72</DmgIconSize>
    <!-- Bounds of the Finder window when opened (left, top, right, bottom) -->
    <DmgBounds Condition="$(DmgBounds) == ''">400, 100, 900, 430</DmgBounds>
    <!-- Location of your app icon (x, y) -->
    <DmgAppLocation Condition="$(DmgAppLocation) == ''">120, 150</DmgAppLocation>
    <!-- Location of the applications shortcut icon (x, y) -->
    <DmgApplicationsShortcutLocation Condition="$(DmgApplicationsShortcutLocation) == ''">380, 150</DmgApplicationsShortcutLocation>
    <!-- Image to use for the background, or 'none' to omit the background image. -->
    <DmgBackgroundImage Condition="$(DmgBackgroundImage) == ''">$(MSBuildThisFileDirectory)Dmg.background.png</DmgBackgroundImage>

Code Signing:

    <!-- add to your csproj -->
    <EnableCodeSigning>True</EnableCodeSigning>

    <!-- Search key for the code signing identity for the .app (partial strings match)
         If empty, this will use the code signing identity if only a single identity is installed.
     -->
    <CodeSigningKey Condition="$(CodeSigningKey) == ''"></CodeSigningKey>
    <!-- Search key for the code signing identity for the .dmg (partial strings match) -->
    <DmgCodeSigningKey Condition="$(DmgCodeSigningKey) == ''">$(CodeSigningKey)</DmgCodeSigningKey>
    <!-- Code signing entitlements to use -->
    <CodeSignEntitlements Condition="$(CodeSignEntitlements) == ''">$(MSBuildThisFileDirectory)CodeSign.entitlements</CodeSignEntitlements>

Notarization:

    <!-- add to your csproj -->
    <EnableNotarization>True</EnableNotarization>

    <!--
      Wait for notarization to complete and staple the DMG.
      Note that this can make the build take a long time waiting for your app to be notarized.
      -->
    <EnableNotarizationStapler Condition="$(EnableNotarizationStapler) == ''">True</EnableNotarizationStapler>

    <!-- Identifier for the notarization, which is returned in the notarization email to identify what has been notarized -->
    <NotarizationBundleIdentifier Condition="$(NotarizationBundleIdentifier) == ''">$(DmgName).dmg</NotarizationBundleIdentifier>

    <!-- The notarization user name. The username can be inferred from the password keychain entry if not specified. -->
    <NotarizationUserName Condition="$(NotarizationUserName) == ''"></NotarizationUserName>

    <!--
      The notarization password. To use from the keychain (the default), use the following command:

      xcrun altool - -store-password-in-keychain-item "AC_PASSWORD" -u "<NotarizationUserName>" -p <secret_password>
    -->
    <NotarizationPassword Condition="$(NotarizationPassword) == ''">@keychain:AC_PASSWORD</NotarizationPassword>

Fixes #1748

@cwensley cwensley force-pushed the curtis/mac-codesign-and-notarization branch 3 times, most recently from da9e55d to 09f2be4 Compare October 17, 2020 08:36
@cwensley cwensley force-pushed the curtis/mac-codesign-and-notarization branch from 09f2be4 to d53b412 Compare November 17, 2020 11:10
@cwensley cwensley merged commit cf84ea1 into develop Nov 17, 2020
@cwensley cwensley deleted the curtis/mac-codesign-and-notarization branch November 17, 2020 12:06
@cwensley cwensley added this to the 2.5.7 milestone Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create facility to package Mac apps
1 participant