Skip to content

Commit ce882c7

Browse files
committed
Ship as ad-hoc-signed GitHub release (no notarization) + force universal build
Distribute like a normal open-source Mac app: ad-hoc signed, no Apple Developer account or notarization; users approve once via "Open Anyway". Critically, force a universal (arm64 + x86_64) build — the app was compiling Apple-Silicon-only, which would have excluded Intel Macs. README documents the first-launch Gatekeeper step.
1 parent 0fe67a7 commit ce882c7

4 files changed

Lines changed: 79 additions & 159 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,23 @@ the license).
3535

3636
## Install
3737

38-
1. Download the latest `Relay.zip` from the [**Releases**](../../releases) page.
39-
2. Unzip and drag **Relay.app** to `/Applications`.
40-
3. Open it. The build is Apple **notarized**, so it runs without Gatekeeper
41-
warnings.
42-
4. On first launch you'll get a short welcome + a Facebook sign-in window. Log in
43-
normally (password, 2FA, checkpoints all work). That's it.
44-
45-
Relay keeps itself up to date — when a new version ships you'll see an **Update**
46-
prompt inside the app; one click installs it and relaunches. (Powered by Sparkle.)
38+
1. Download **`Relay.dmg`** from the [**Releases**](../../releases) page.
39+
2. Open it and drag **Relay.app** to **Applications**.
40+
3. **First launch — approve it once.** Relay is a free open-source app, not signed
41+
through Apple's paid program, so macOS asks you to confirm it:
42+
- **macOS 15 / 26:** double-click Relay → in the dialog click **Done**, then open
43+
**System Settings → Privacy & Security**, scroll down and click **“Open Anyway”** →
44+
**Open**.
45+
- **macOS 13 / 14 (incl. Intel):** **right-click** (Control-click) Relay.app →
46+
**Open** → **Open**.
47+
48+
You only do this once; afterwards it opens normally.
49+
4. You'll get a short welcome + a Facebook sign-in window. Log in normally (password,
50+
2FA, checkpoints all work). That's it.
51+
52+
When a new version ships, **Settings → Download the Latest Version** (or *Relay → Check
53+
for Updates…*) fetches and installs it in one click — no need to come back here.
54+
(Powered by Sparkle; updates are verified by signature.)
4755

4856
## Compatibility
4957

‎RELEASE.md‎

Lines changed: 35 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,57 @@
11
# Signing & releasing Relay
22

3-
Relay uses **local** notifications (`UNUserNotificationCenter`), so it needs **no**
4-
push entitlement and **no** provisioning profile. Signing exists only to give the
5-
app a stable, trusted identity.
3+
Relay is distributed like most open-source Mac apps: **ad-hoc signed, not notarized,
4+
tied to no Apple Developer account.** Users approve it once on first launch (System
5+
Settings → Privacy & Security → "Open Anyway"). No paid membership, certificates, or
6+
notarization needed. Auto-update still works — Sparkle verifies its own EdDSA signature
7+
on the appcast, independent of Apple.
68

7-
## Use it now (no Developer ID needed)
8-
Builds the universal Go helper + the app, signs with your *Apple Development* cert,
9-
installs to `/Applications`, runs:
9+
## Run locally
1010
```bash
1111
scripts/run-native.sh
1212
```
13-
Grant **Notifications**/**Microphone** on first launch. Because it's signed with a
14-
stable identity, those permissions persist across rebuilds. This is all you need to
15-
start using Relay yourself.
13+
Builds the universal Go helper + app, signs locally, installs to `/Applications`, runs.
1614

17-
> Set `DEVELOPMENT_TEAM` in `project.yml` to your own Apple Developer team id first.
18-
19-
## Make a notarized, shareable build
20-
One-time setup (needs your own Apple Developer account + paid membership):
21-
22-
1. **Create a Developer ID Application certificate**
23-
Xcode → Settings → Accounts → select your team → *Manage Certificates…*
24-
→ **+** → **Developer ID Application**.
25-
26-
2. **Store notary credentials** as a keychain profile. Generate an app-specific
27-
password at <https://appleid.apple.com> → Sign-In & Security → App-Specific
28-
Passwords, then:
29-
```bash
30-
xcrun notarytool store-credentials relay-notary \
31-
--apple-id "<your-apple-id-email>" --team-id "<YOUR_TEAM_ID>" --password "<app-specific-password>"
32-
```
33-
(The release script reads the team id from its `TEAM` variable — set it to your own.)
34-
35-
Then, any time you want a distributable build:
15+
## Cut a release
3616
```bash
3717
scripts/release.sh
3818
```
39-
It builds the universal Go helper + app → bundles + signs with Developer ID + hardened
40-
runtime + secure timestamp → notarizes (waits for Apple) → staples → outputs a notarized
41-
`dist/Relay.app`, a drag-to-Applications `dist/Relay.dmg`, and `dist/Relay.zip` that run
42-
warning-free on any Mac. Publish with `gh release create` (the script prints the command).
19+
Builds the universal (Intel + Apple Silicon) helper + app, **ad-hoc signs** it, and
20+
produces:
21+
- `dist/Relay.dmg` — the drag-to-Applications download for the Releases page
22+
- `dist/Relay.zip` — the Sparkle update artifact
23+
- `dist/appcast.xml` — the EdDSA-signed update feed
24+
25+
It prints the exact `gh release create` command, e.g.:
26+
```bash
27+
gh release create v1.0 dist/Relay.dmg dist/Relay.zip dist/appcast.xml \
28+
--title "Relay v1.0" --notes "…"
29+
```
30+
The tag **must** be `v<MARKETING_VERSION>` so the appcast's download URLs resolve.
31+
Bump `MARKETING_VERSION` **and** `CURRENT_PROJECT_VERSION` in `project.yml` before each
32+
release (Sparkle compares `CURRENT_PROJECT_VERSION` to decide what's newer).
4333

4434
## Auto-update (Sparkle)
4535

46-
Relay ships with [Sparkle](https://sparkle-project.org): it checks a signed `appcast.xml`
47-
on GitHub Releases in the background and offers a one-click in-app update — users never
48-
visit GitHub. Wiring is already done (SPM dependency + `SUFeedURL`/`SUPublicEDKey` in the
49-
generated `Info.plist`, pointing at `releases/latest/download/appcast.xml`).
36+
Wiring is done: the Sparkle SPM dependency plus `SUFeedURL`/`SUPublicEDKey` in the
37+
generated `Info.plist`, pointing at `releases/latest/download/appcast.xml`. Updates are
38+
**manual** — the user clicks "Download the Latest Version" (Settings) or "Check for
39+
Updates…" (menu); there are no background checks.
5040

51-
**One-time:** the EdDSA signing keypair is generated with Sparkle's `generate_keys`
52-
(private key stays in your login Keychain; the public key is `SUPublicEDKey` in
53-
`project.yml`). The Sparkle CLI tools (`generate_keys`, `generate_appcast`, `sign_update`)
54-
come from the Sparkle release tarball — `release.sh` looks for them in `.sparkle-tools/`
55-
(git-ignored) or the resolved SPM artifacts. To (re)fetch:
41+
The EdDSA signing keypair was made once with Sparkle's `generate_keys` (private key in
42+
your login Keychain; public key is `SUPublicEDKey` in `project.yml`). `release.sh` signs
43+
the appcast with `generate_appcast`, looking for the Sparkle CLI tools in `.sparkle-tools/`
44+
(git-ignored) or the resolved SPM artifacts. To (re)fetch the tools:
5645
```bash
5746
TAG=$(gh release view --repo sparkle-project/Sparkle --json tagName -q .tagName)
5847
mkdir -p .sparkle-tools && cd .sparkle-tools
5948
curl -fsSL "https://github.com/sparkle-project/Sparkle/releases/download/$TAG/Sparkle-$TAG.tar.xz" | tar -xJ
6049
```
6150

62-
**Each release:**
63-
1. Bump `MARKETING_VERSION` **and** `CURRENT_PROJECT_VERSION` in `project.yml`
64-
(Sparkle compares `CURRENT_PROJECT_VERSION` to decide what's newer).
65-
2. `scripts/release.sh` → produces `dist/Relay.dmg`, `dist/Relay.zip`, and a signed
66-
`dist/appcast.xml`, and prints the exact `gh release create vX …` command.
67-
3. Run that command. The tag **must** be `v<MARKETING_VERSION>` so the appcast's
68-
download URLs resolve. Uploading `appcast.xml` to the latest release is what triggers
69-
everyone's auto-update.
70-
7151
## Notes
72-
- `project.yml` uses **Automatic** signing for the Xcode IDE (Run just works when you're
73-
signed into your Developer account). The release script re-signs with explicit
74-
`codesign`, so it never depends on provisioning profiles.
52+
- The project is **ad-hoc signed** (`CODE_SIGN_IDENTITY "-"`, no team). To run from Xcode
53+
with your own account instead, set `CODE_SIGN_STYLE: Automatic` + your team in `project.yml`.
7554
- Entitlements (`RelayNative/RelayNative.entitlements`) cover hardened-runtime JIT +
76-
microphone access; the app is not sandboxed (direct distribution only).
55+
microphone; the app is not sandboxed (direct distribution only).
56+
- Want warning-free installs later? You can add a paid Developer ID + notarization step
57+
on top of this without changing anything else.

‎project.yml‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,18 @@ settings:
2020
MARKETING_VERSION: "1.0"
2121
CURRENT_PROJECT_VERSION: "1"
2222
SWIFT_VERSION: "5.0"
23-
# IDE signing: automatic. Open Relay.xcodeproj in Xcode signed into your own Apple
24-
# Developer account and set DEVELOPMENT_TEAM below to your team id; Xcode then signs
25-
# with your Apple Development cert (a stable identity, so notification permission
26-
# persists across rebuilds). The notarized Developer ID release is produced by
27-
# scripts/release.sh, which re-signs with explicit `codesign` (no profile needed).
28-
CODE_SIGN_STYLE: Automatic
29-
DEVELOPMENT_TEAM: "ULHJAB7ZT3"
23+
# No Apple Developer account required: builds are ad-hoc signed (CODE_SIGN_IDENTITY "-").
24+
# scripts/release.sh re-signs the bundle ad-hoc and ships it on GitHub Releases; users
25+
# approve it once via System Settings → Privacy & Security → "Open Anyway". To run from
26+
# Xcode with your own account instead, set CODE_SIGN_STYLE to Automatic + your team.
27+
CODE_SIGN_STYLE: Manual
28+
CODE_SIGN_IDENTITY: "-"
3029
ENABLE_HARDENED_RUNTIME: YES
3130
DEAD_CODE_STRIPPING: YES
32-
# Apple-Silicon-first; universal so it also runs on Intel.
33-
ARCHS: "$(ARCHS_STANDARD)"
31+
# Universal so it runs on Intel too (release.sh also forces both arches +
32+
# ONLY_ACTIVE_ARCH=NO to guarantee a fat binary regardless of host).
33+
ARCHS: "arm64 x86_64"
34+
ONLY_ACTIVE_ARCH: NO
3435

3536
targets:
3637
# The native SwiftUI client (Liquid Glass), driven by the Go relay-helper

‎scripts/release.sh‎

Lines changed: 17 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,19 @@
11
#!/bin/bash
2-
# Build, Developer-ID-sign, notarize and staple Relay into a distributable .app
3-
# (+ .zip) that runs warning-free on any Mac.
2+
# Build Relay into a distributable, AD-HOC-signed .app + .dmg for GitHub Releases.
43
#
5-
# Prerequisites (one-time — see RELEASE.md):
6-
# 1. A "Developer ID Application" certificate in your keychain.
7-
# 2. Notary credentials stored as a keychain profile named "relay-notary":
8-
# xcrun notarytool store-credentials relay-notary \
9-
# --apple-id "<your-apple-id>" --team-id ULHJAB7ZT3 --password "<app-specific-password>"
4+
# NOT notarized and tied to no Apple Developer account — like most open-source Mac
5+
# apps. On first launch users approve it once via System Settings → Privacy &
6+
# Security → "Open Anyway" (or right-click → Open on older macOS). Auto-update still
7+
# works: Sparkle verifies the EdDSA-signed appcast, independent of Apple notarization.
108
#
119
# Usage: scripts/release.sh
1210
set -euo pipefail
1311

1412
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1513
cd "$ROOT"
16-
1714
DEV="/Applications/Xcode.app/Contents/Developer"
18-
ENT="$ROOT/RelayNative/RelayNative.entitlements"
19-
TEAM="ULHJAB7ZT3"
20-
NOTARY_PROFILE="relay-notary"
2115
DIST="$ROOT/dist"
2216

23-
# --- preflight ---------------------------------------------------------------
24-
IDENTITY=$(security find-identity -v -p codesigning \
25-
| grep "Developer ID Application" | grep "$TEAM" | head -1 | awk '{print $2}')
26-
if [ -z "${IDENTITY:-}" ]; then
27-
cat >&2 <<EOF
28-
error: no "Developer ID Application" certificate for team $TEAM found.
29-
30-
Create one first (see RELEASE.md):
31-
Xcode → Settings → Accounts → (select your team) → Manage Certificates →
32-
+ → "Developer ID Application". Then re-run this script.
33-
EOF
34-
exit 1
35-
fi
36-
echo "Developer ID identity: $IDENTITY"
37-
38-
if ! xcrun notarytool history --keychain-profile "$NOTARY_PROFILE" >/dev/null 2>&1; then
39-
cat >&2 <<EOF
40-
error: notary credentials profile "$NOTARY_PROFILE" not found.
41-
42-
Store them once (needs an app-specific password from appleid.apple.com):
43-
xcrun notarytool store-credentials $NOTARY_PROFILE \\
44-
--apple-id "<your-apple-id-email>" --team-id $TEAM --password "<app-specific-password>"
45-
EOF
46-
exit 1
47-
fi
48-
49-
# --- build (unsigned) --------------------------------------------------------
5017
echo "→ Building universal Go helper (arm64 + amd64)…"
5118
( cd relay-helper
5219
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o relay-helper.arm64 .
@@ -58,79 +25,42 @@ echo "→ Generating project + building Release…"
5825
xcodegen generate >/dev/null
5926
DEVELOPER_DIR="$DEV" xcodebuild -project Relay.xcodeproj -scheme Relay \
6027
-configuration Release -derivedDataPath build \
61-
CODE_SIGNING_ALLOWED=NO build >/dev/null
28+
ARCHS="arm64 x86_64" ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=NO build >/dev/null
6229

6330
APP_SRC="build/Build/Products/Release/Relay.app"
6431
[ -d "$APP_SRC" ] || { echo "error: build product missing" >&2; exit 1; }
65-
6632
rm -rf "$DIST"; mkdir -p "$DIST"
6733
APP="$DIST/Relay.app"
6834
cp -R "$APP_SRC" "$APP"
6935

70-
# --- bundle the Go backend + sign (hardened runtime + secure timestamp) -------
71-
echo "→ Bundling helper…"
36+
echo "→ Bundling helper + ad-hoc signing (inside-out)…"
7237
mkdir -p "$APP/Contents/Resources"
7338
cp relay-helper/relay-helper "$APP/Contents/Resources/relay-helper"
74-
codesign --force --options runtime --timestamp \
75-
--sign "$IDENTITY" "$APP/Contents/Resources/relay-helper"
76-
77-
# Sign embedded frameworks + their nested helpers (Sparkle ships Autoupdate,
78-
# Updater.app and XPC services that must each be signed from the inside out,
79-
# BEFORE the outer app, or notarization rejects the bundle).
39+
codesign --force --sign - "$APP/Contents/Resources/relay-helper"
8040
if [ -d "$APP/Contents/Frameworks" ]; then
81-
echo "→ Signing embedded frameworks…"
82-
# Nested helpers first (deepest), at any depth — Sparkle's XPC services live under
83-
# Sparkle.framework/Versions/B/XPCServices, plus Autoupdate + Updater.app.
8441
find "$APP/Contents/Frameworks" \( -name "*.xpc" -o -name "*.app" -o -name "Autoupdate" -o -name "*.dylib" \) -print0 \
85-
| while IFS= read -r -d '' nested; do
86-
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$nested"
87-
done
88-
# Then the frameworks themselves.
42+
| while IFS= read -r -d '' n; do codesign --force --sign - "$n"; done
8943
find "$APP/Contents/Frameworks" -maxdepth 1 -name "*.framework" -print0 \
90-
| while IFS= read -r -d '' fw; do
91-
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$fw"
92-
done
44+
| while IFS= read -r -d '' fw; do codesign --force --sign - "$fw"; done
9345
fi
46+
codesign --force --sign - "$APP"
47+
codesign --verify --deep --strict "$APP" && echo " ad-hoc signature ok"
9448

95-
echo "→ Signing app with Developer ID…"
96-
codesign --force --options runtime --timestamp \
97-
--entitlements "$ENT" --sign "$IDENTITY" "$APP"
98-
codesign --verify --deep --strict --verbose=2 "$APP"
49+
VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$APP/Contents/Info.plist" 2>/dev/null || echo "1.0")
9950

100-
# --- notarize ----------------------------------------------------------------
51+
echo "→ Zipping (Sparkle update artifact)…"
10152
ZIP="$DIST/Relay.zip"
102-
echo "→ Zipping + submitting to Apple notary service (this can take a few minutes)…"
103-
ditto -c -k --keepParent "$APP" "$ZIP"
104-
xcrun notarytool submit "$ZIP" --keychain-profile "$NOTARY_PROFILE" --wait
105-
106-
# --- staple + verify ---------------------------------------------------------
107-
echo "→ Stapling ticket…"
108-
xcrun stapler staple "$APP"
109-
spctl -a -t exec -vv "$APP" 2>&1 | sed 's/^/ /'
110-
111-
# refresh the zip with the stapled app (used by Sparkle's appcast)
112-
rm -f "$ZIP"
11353
ditto -c -k --keepParent "$APP" "$ZIP"
11454

115-
# --- build a drag-to-Applications DMG, then notarize + staple it -------------
55+
echo "→ Building drag-to-Applications DMG…"
11656
DMG="$DIST/Relay.dmg"
117-
echo "→ Building DMG…"
118-
STAGING="$DIST/dmg-staging"
119-
rm -rf "$STAGING"; mkdir -p "$STAGING"
57+
STAGING="$DIST/dmg-staging"; rm -rf "$STAGING"; mkdir -p "$STAGING"
12058
cp -R "$APP" "$STAGING/Relay.app"
12159
ln -s /Applications "$STAGING/Applications"
12260
hdiutil create -volname "Relay" -srcfolder "$STAGING" -ov -format UDZO "$DMG" >/dev/null
12361
rm -rf "$STAGING"
124-
echo "→ Notarizing DMG…"
125-
xcrun notarytool submit "$DMG" --keychain-profile "$NOTARY_PROFILE" --wait
126-
xcrun stapler staple "$DMG"
127-
spctl -a -t open --context context:primary-signature -vv "$DMG" 2>&1 | sed 's/^/ /' || true
128-
129-
VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$APP/Contents/Info.plist" 2>/dev/null || echo "0.1")
13062

13163
# --- Sparkle appcast (EdDSA-signed; private key lives in your Keychain) -------
132-
# generate_appcast comes from the Sparkle tools. Set GENAPPCAST, or download the
133-
# Sparkle release tarball into .sparkle-tools/ (see RELEASE.md).
13464
GENAPPCAST="${GENAPPCAST:-$ROOT/.sparkle-tools/bin/generate_appcast}"
13565
if [ ! -x "$GENAPPCAST" ]; then
13666
GENAPPCAST=$(find "$ROOT/build" -name generate_appcast -type f 2>/dev/null | head -1)
@@ -150,7 +80,7 @@ else
15080
fi
15181

15282
echo "✓ Done."
153-
echo " Notarized app: $APP"
83+
echo " App: $APP (ad-hoc signed, not notarized)"
15484
echo " DMG (direct download): $DMG"
15585
echo " Zip (Sparkle update): $ZIP"
15686
[ -n "$APPCAST" ] && echo " Appcast (auto-update): $APPCAST"

0 commit comments

Comments
 (0)