Releasing
The repository has no signing secrets. Thus CI cannot make the build that users download. The maintainer builds, signs and notarizes the release on a Mac. Then the maintainer attaches the zip to a draft release, verifies it, and publishes it.
Procedure
-
Push the tag. Tag a commit on
mainthat passed CI.git tag vX.Y.Z && git push origin vX.Y.Z -
Build locally from the tag. You need the “Developer ID Application” certificate in the keychain. You also need the notary profile. Create the profile one time with
xcrun notarytool store-credentials pretype.- Check out the tag. The working tree must be clean:
git status --shortmust show nothing. - Run
dist.shwithPRETYPE_VERSION. It builds the app withmake-app.sh, then signs, notarizes and staples it. - Go back to
main.
git switch --detach vX.Y.Z git status --short # must show nothing PRETYPE_VERSION=X.Y.Z ./Scripts/dist.sh # make-app.sh, hardened-runtime sign, notarize (--keychain-profile pretype), staple git switch mainCI builds with Xcode 26.6 (
XCODE_VERSIONinci.yml). The release uses the same version.The scripts stop before the build in these conditions:
PRETYPE_VERSIONis not set.dist.shsigns only an app that it builds from the tag. It never signs an existingbuild/Pretype.app.- The working tree has a change or an untracked file.
HEADis not at the tagvX.Y.Z.HEADis not onorigin/main. Pushmainand wait for CI first. Then dogit fetch origin.- CI on
HEADdid not pass. This check needs theghCLI. - The Xcode version is not the version in
ci.yml. Install it next to your Xcode, as/Applications/Xcode_X.Y.app.dist.shthen selects it. To build with another Xcode, setPRETYPE_ANY_XCODE=1, and do a smoke test of the zip on the oldest macOS that Pretype supports. - The “Developer ID Application” certificate is not in the keychain.
NOTE:
notarytool --waitcan stop after a short network failure. The submission continues on the server. Do not submit again. Do the steps in If notarytool stops. - Check out the tag. The working tree must be clean:
-
Create a draft release with the zip. GitHub generates the release notes.
gh release create vX.Y.Z build/Pretype.app.zip --draft --generate-notes -
Verify the zip that is attached to the release, not the local copy.
rm -rf /tmp/pt && gh release download vX.Y.Z -p Pretype.app.zip -D /tmp/pt ditto -x -k /tmp/pt/Pretype.app.zip /tmp/pt spctl -a -t exec -vv /tmp/pt/Pretype.app # expect: source=Notarized Developer ID xcrun stapler validate /tmp/pt/Pretype.app # expect: The validate action worked! -
Publish the draft.
gh release edit vX.Y.Z --draft=false -
Bump the Homebrew cask in
nikiomori/homebrew-tap(Casks/pretype.rb):- Set
versiontoX.Y.Z. - Set
sha256to the output ofshasum -a 256 build/Pretype.app.zip. - Commit with the message
pretype X.Y.Z.
- Set
If notarytool stops
dist.sh stops when notarytool --wait stops. The signed app is in build/dist/Pretype.app, but it has no ticket yet. Do not run dist.sh again. Do these steps:
-
Find the ID of the submission. Use the entry with the newest
createdDate.xcrun notarytool history --keychain-profile pretype -
Wait for the result. The status must be
Accepted. If the status isInvalid, read the reason withxcrun notarytool log <id> --keychain-profile pretype.xcrun notarytool wait <id> --keychain-profile pretype -
Staple the ticket to the app. Then make the zip again from the stapled app.
xcrun stapler staple build/dist/Pretype.app rm -f build/Pretype.app.zip ditto -c -k --keepParent build/dist/Pretype.app build/Pretype.app.zip -
Validate the app.
xcrun stapler validate build/dist/Pretype.app # expect: The validate action worked! spctl -a -t exec -vv build/dist/Pretype.app # expect: source=Notarized Developer ID -
Continue with step 3 of the procedure.