Skip to content

Commit 6814668

Browse files
rlespinasseclaude
andauthored
feat: ad-hoc sign macOS binaries with rcodesign (#12)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e676ba4 commit 6814668

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

.github/workflows/goreleaser.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ jobs:
5353
with:
5454
go-version-file: go.mod
5555

56+
- name: Install rcodesign
57+
if: inputs.dry_run || steps.check.outputs.match == 'true'
58+
env:
59+
RCODESIGN_VERSION: "0.27.0"
60+
run: |
61+
curl -fsSL "https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F${RCODESIGN_VERSION}/apple-codesign-${RCODESIGN_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
62+
| tar xz -C /usr/local/bin --strip-components=1 --wildcards '*/rcodesign'
63+
5664
- name: Run GoReleaser
5765
if: inputs.dry_run || steps.check.outputs.match == 'true'
5866
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0

.goreleaser.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
version: 2
22

33
builds:
4-
- binary: ghat
4+
- id: default
5+
binary: ghat
56
env:
67
- CGO_ENABLED=0
78
goos:
89
- linux
9-
- darwin
1010
- windows
1111
goarch:
1212
- amd64
1313
- arm64
14+
- id: darwin
15+
binary: ghat
16+
env:
17+
- CGO_ENABLED=0
18+
goos:
19+
- darwin
20+
goarch:
21+
- amd64
22+
- arm64
23+
24+
signs:
25+
- cmd: rcodesign
26+
args:
27+
- sign
28+
- "${artifact}"
29+
ids:
30+
- darwin
31+
artifacts: binary
32+
output: false
1433

1534
archives:
1635
- formats:

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ A CLI toolbox for GitHub Actions utilities.
1010
brew install rlespinasse/tap/ghat
1111
```
1212

13+
#### macOS Gatekeeper notice
14+
15+
On macOS, you may see a warning: _"Apple is not able to verify that it is free from malware that could harm your Mac or compromise your privacy."_
16+
17+
This is because the binary is ad-hoc signed but not notarized by Apple.
18+
19+
> [!NOTE]
20+
> Apple notarization requires a paid Apple Developer account ($99/year). It consists of an automated malware scan — not a manual security review or code audit — and does not guarantee the software is safe. Open-source projects can be verified by reviewing the source code and build pipeline directly.
21+
22+
To allow it to run, either:
23+
24+
- **Via System Settings (UI):** Go to **System Settings > Privacy & Security**, scroll down, and click **Open Anyway** next to the blocked app message.
25+
- **Via terminal:**
26+
27+
```bash
28+
xattr -d com.apple.quarantine $(which ghat)
29+
```
30+
1331
### From source
1432

1533
```bash

0 commit comments

Comments
 (0)