Releasing
A release is a signed, notarized Refr-<version>-arm64.dmg and .zip attached to a GitHub
release.
One-time setup
-
Developer ID certificate. Install a "Developer ID Application" certificate in your login keychain. Check with:
security find-identity -v -p codesigning -
Notarization credentials. Store an app-specific password as a notarytool profile:
xcrun notarytool store-credentials <profile> --apple-id <apple-id> --team-id <team-id> -
GitHub CLI.
gh auth loginwith access to the repository.
Steps
-
Bump the version in the workspace
Cargo.toml([workspace.package] version). The About window andInfo.plistread it from there. -
Run the tests and make sure the build has no warnings:
cargo test -
Build, sign and notarize:
NOTARY_PROFILE=<profile> scripts/release.shThis:
- builds
target/bundle/Refr.appwithscripts/bundle.sh, signed with the first Developer ID identity in the keychain (orSIGN_IDENTITY), with the hardened runtime and a secure timestamp.libpdfium.dylibis signed first, then the app that seals it. - notarizes the app and staples the ticket, so it works offline once it's copied out of the disk image
- writes
Refr-<version>-arm64.zip - builds
Refr-<version>-arm64.dmgwith an Applications shortcut, then signs, notarizes and staples it - checks both with
spctland prints their SHA-256 checksums
Notarization usually takes a few minutes. Without
NOTARY_PROFILE, everything is signed but not notarized, and Gatekeeper warns on other Macs. - builds
-
Smoke test the notarized app: open it, open a PDF, add an annotation and export.
-
Commit, tag and push:
git commit -am "Refr <version>" git tag -a v<version> -m "Refr <version>" git push && git push origin v<version> -
Publish the release:
gh release create v<version> \ target/bundle/Refr-<version>-arm64.dmg \ target/bundle/Refr-<version>-arm64.zip \ --title "Refr <version>" --notes-file notes.mdInclude what changed, install instructions, known limitations and the SHA-256 checksums from step 3.
The app icon
resources/AppIcon.icns is drawn by scripts/make_icon.swift with CoreGraphics. To change
it, edit the script and run:
swift scripts/make_icon.swift
It writes every size from 16 to 1024 pixels into AppIcon.icns, plus AppIcon.png at
1024 pixels. Commit both.
What's in the bundle
Refr.app/Contents/
Info.plist bundle ID no.gets.refr, version, document types
MacOS/Refr the release binary
Frameworks/libpdfium.dylib
Resources/AppIcon.icns
Resources/licenses/ Refr-LICENSE.txt, PDFium-LICENSE.txt
Info.plist registers Refr as an alternate handler for PDFs (so it doesn't take over as
the default PDF app) and the owner of .pdfspace files. The minimum system version is
macOS 13.
Architecture
Releases are arm64 only, because the bundled PDFium is the mac-arm64 build. An Intel or
universal build needs the mac-x64 PDFium, a separate x86_64-apple-darwin build, and
lipo to combine the binaries and libraries.