Skip to content

Commit 744db7b

Browse files
committed
docs: WIP Mac codesigning docs
1 parent 6d2e441 commit 744db7b

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Custom Builds](./custom-builds.md)
1212
- [Supplychain Security](./supplychain-security/index.md)
1313
- [Windows Signing](./supplychain-security/signing/windows.md)
14+
- [macOS Signing](./supplychain-security/signing/macos.md)
1415
- [GitHub Attestations](./supplychain-security/attestations/github.md)
1516
- [Installers](./installers/index.md)
1617
- [shell](./installers/shell.md)

book/src/reference/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ We're currently in the middle of [a major config migration](https://github.com/a
2525
* [`extra-artifacts`](#extra-artifacts)
2626
* [`source-tarball`](#source-tarball)
2727
* [`ssldotcom-windows-sign`](#ssldotcom-windows-sign)
28+
* [`macos-sign`](#macos-sign)
2829
* [archive settings](#artifact-settings)
2930
* [`auto-includes`](#auto-includes)
3031
* [`include`](#include)

book/src/supplychain-security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If you have an integration you are looking for [file an issue](https://github.co
99
## Signing
1010

1111
* [Windows Codesigning](./signing/windows.md)
12-
* [🔜 macOS Codesigning](https://github.com/axodotdev/cargo-dist/issues/1121)
12+
* [macOS Codesigning](./signing/macos.md)
1313
* [🔜 Linux Codesigning](https://github.com/axodotdev/cargo-dist/issues/120)
1414
* [🔜 Sigstore Signing](https://github.com/axodotdev/cargo-dist/issues/120)
1515
* [🔜 Windows Trusted Signing](https://github.com/axodotdev/cargo-dist/issues/1122)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# MacOS Artifact Signing
2+
3+
> since 0.22.0
4+
5+
cargo-dist can automatically codesign Mac executables using Apple's builtin tooling.
6+
7+
## Quickstart
8+
9+
### Part 1: Provision a certificate and set up your repository with it
10+
11+
<!-- TODO: Document the process of obtaining and exporting the signature. -->
12+
13+
3. **Export the certificate to disk**
14+
15+
Locate your certificate within Keychain, then right-click and select "Export". Ensure that you've selected the "Personal Information Exchange (.p12)" format at the bottom of the export window. Once you've selected a filename, Keychain will prompt you for a password to protect the exported item. Select a secure password, *and ensure remember it* - you'll need this for the next step.
16+
17+
4. **Encode the certificate via base64**
18+
19+
In order to add the certificate to your GitHub secrets in a future step, we'll need to convert it to a text-based format. To do that, we'll use base64. In your terminal, run the following:
20+
21+
```sh
22+
base64 < PATH_TO_YOUR_CERT
23+
```
24+
25+
(Instead of typing the path to your certificate, you can also drag and drop it onto your terminal after typing `base64 <`.)
26+
27+
Copy *the full text* that was generated; you'll need it in the next step.
28+
29+
5. **Add [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to your repository**
30+
31+
You'll need the following three secrets:
32+
33+
- `CODESIGN_IDENTITY`: the identity in the certificate
34+
- `CODESIGN_CERTIFICATE_PASSWORD`: this is the base64-encoded certificate from Step 4
35+
- `CODESIGN_CERTIFICATE_PASSWORD`: this is the password from Step 3
36+
37+
### Part 2: Enable macOS signing with cargo-dist
38+
39+
1. **Configure cargo-dist to codesign**
40+
41+
Add the following to your `Cargo.toml` or `dist.toml`:
42+
43+
```toml
44+
[workspace.metadata.dist]
45+
macos-sign = true
46+
```
47+
48+
2. **Run `cargo dist init` on your project**
49+
50+
You've already fully configured the feature, we're just ensuring your config changes are applied and checked.

0 commit comments

Comments
 (0)