Skip to content

Commit

Permalink
Merge pull request #1100 from mhsmith/macos-signing
Browse files Browse the repository at this point in the history
macOS signing and notarization fixes
  • Loading branch information
freakboy3742 authored Feb 14, 2023
2 parents 12525af + 6d88c36 commit 3119fd0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions changes/1100.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The command to store notarization credentials no longer causes Briefcase to hang.
4 changes: 2 additions & 2 deletions docs/how-to/code-signing/macOS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ certificate.
Next steps
----------

Now it's time to start using the Developer ID Application Certificate to sign,
notarize, and distribute your application!
Now you can use the certificate to sign and notarize your application with the
:doc:`briefcase package </reference/commands/package>` command.
2 changes: 1 addition & 1 deletion docs/reference/commands/package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ Sign app with adhoc identity.
``-i <identity>`` / ``--identity <identity>``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code signing identity to use when signing the app.
The :doc:`code signing identity </how-to/code-signing/index>` to use when signing the app.
6 changes: 5 additions & 1 deletion src/briefcase/platforms/macOS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ def select_identity(self, identity=None):
) from e

if len(identities) == 0:
raise BriefcaseCommandError("No code signing identities are available.")
raise BriefcaseCommandError(
"No code signing identities are available: see "
"https://briefcase.readthedocs.io/en/stable/how-to/code-signing/macOS.html"
)
elif len(identities) == 1:
identity, identity_name = list(identities.items())[0]
else:
Expand Down Expand Up @@ -497,6 +500,7 @@ def notarize(self, filename, team_id):
profile,
],
check=True,
stream_output=False, # Command reads from stdin.
)
except subprocess.CalledProcessError as e:
raise BriefcaseCommandError(
Expand Down
4 changes: 4 additions & 0 deletions tests/platforms/macOS/app/test_package__notarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def test_notarize_dmg_unknown_credentials(package_command, first_app_dmg):
"briefcase-macOS-DEADBEEF",
],
check=True,
stream_output=False,
),
# Submit for notarization a second time
mock.call(
Expand Down Expand Up @@ -269,6 +270,7 @@ def test_credential_storage_failure_app(
"briefcase-macOS-DEADBEEF",
],
check=True,
stream_output=False,
),
]
)
Expand Down Expand Up @@ -326,6 +328,7 @@ def test_credential_storage_failure_dmg(package_command, first_app_dmg):
"briefcase-macOS-DEADBEEF",
],
check=True,
stream_output=False,
),
]
)
Expand Down Expand Up @@ -480,6 +483,7 @@ def test_notarize_unknown_credentials_after_storage(package_command, first_app_d
"briefcase-macOS-DEADBEEF",
],
check=True,
stream_output=False,
),
# Submit for notarization a second time
mock.call(
Expand Down
5 changes: 4 additions & 1 deletion tests/platforms/macOS/app/test_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def test_no_identities(dummy_command):

with pytest.raises(
BriefcaseCommandError,
match=r"No code signing identities are available.",
match=(
r"No code signing identities are available: see "
r"https://briefcase.readthedocs.io/en/stable/how-to/code-signing/macOS.html"
),
):
dummy_command.select_identity()

Expand Down

0 comments on commit 3119fd0

Please sign in to comment.