Commit 6aca480c0e
6aca480c0e82979f9ea68f67926528c645e85dd5
parent: 6119af383f
Verified · cmc
cmc <hello@cleberg.net> · 2026-10-16 02:19 UTC
TestFlight release script for the iOS app
scripts/release-ios.sh archives the Orgstar iOS scheme with its extensions
and the watch app and uploads it to App Store Connect, signed automatically
through the Apple ID signed in to Xcode. The build number is the commit
count; ORGSTAR_PUBLISH=0 exports the .ipa without uploading.
Closes #8
Layout: unified · split
CONTRIBUTING.org
+9 −2
| @@ -4,8 +4,8 @@ |
| 4 | 4 | |
| 5 | 5 | Design phases 1–7 are built. The Mac app is released as a notarized DMG and a Homebrew |
| 6 | 6 | cask, with Sparkle updates. The iOS and watchOS apps build from the Xcode project for the |
| 7 | | Simulator and for a device signed with your own team; device signing and TestFlight for |
| 8 | | releases are not set up (issue 8). Owed: the M1 Air gate run (issue 2) and the VoiceOver |
| 7 | Simulator and for a device signed with your own team, and go to TestFlight with |
| 8 | =scripts/release-ios.sh=. Owed: the M1 Air gate run (issue 2) and the VoiceOver |
| 9 | 9 | passes on the Mac and iOS (issues 3 and 4). |
| 10 | 10 | |
| 11 | 11 | =docs/design.md= is the design; =docs/plans/= has one plan per piece of work. |
| @@ -69,6 +69,13 @@ Set =ORGSTAR_NOTES= to an HTML file of release notes for the appcast, which Spar |
| 69 | 69 | update window shows, and =ORGSTAR_RELEASE_NOTES= to a Markdown file for the gitbay |
| 70 | 70 | release. Without them both get the one-line platform note. |
| 71 | 71 | |
| 72 | =scripts/release-ios.sh= then archives the =Orgstar iOS= scheme, with its extensions and the |
| 73 | watch app, and uploads it to App Store Connect for TestFlight. It signs automatically with the |
| 74 | team's distribution certificate through the Apple ID signed in to Xcode (Xcode ▸ Settings ▸ |
| 75 | Accounts), so it needs no key of its own. The version is the project's =MARKETING_VERSION=; |
| 76 | the build number is the commit count, as the Mac's is, so each upload needs a new commit. |
| 77 | =ORGSTAR_PUBLISH=0= archives and exports the =.ipa= to =.build/ios-release= without uploading. |
| 78 | |
| 72 | 79 | * App Store header |
| 73 | 80 | |
| 74 | 81 | =ios/AppStore/header.html= renders the product page headers; the commands are in the |
README.org
+2 −1
| @@ -56,6 +56,7 @@ or download the notarized DMG from the |
| 56 | 56 | [[https://gitbay.org/krz/orgstar/releases][releases page]]. The iPhone and iPad app (iOS 26 |
| 57 | 57 | or later) is built from source with Xcode; see [[file:docs/manual/install.org]]. |
| 58 | 58 | |
| 59 | | To build from source or contribute, see [[file:CONTRIBUTING.org]]. |
| 59 | To build from source, contribute or release (the Mac app and TestFlight), see |
| 60 | [[file:CONTRIBUTING.org]]. |
| 60 | 61 | |
| 61 | 62 | License: 0BSD. |
scripts/release-ios.sh
added
+63
| @@ -0,0 +1,63 @@ |
| 1 | #!/bin/sh |
| 2 | # Archives the iOS app (with its extensions and the watch app) and uploads it to App Store |
| 3 | # Connect for TestFlight, signed automatically with the team's distribution certificate through |
| 4 | # the Apple ID signed in to Xcode. The version is the project's MARKETING_VERSION; the build |
| 5 | # number is the commit count, as the Mac release's is. Run after scripts/release-mac.sh. |
| 6 | # Usage: scripts/release-ios.sh |
| 7 | # ORGSTAR_PUBLISH 0 archives and exports the .ipa to .build/ios-release without uploading |
| 8 | set -eu |
| 9 | |
| 10 | cd "$(dirname "$0")/.." |
| 11 | publish="${ORGSTAR_PUBLISH:-1}" |
| 12 | team=ZCNAX3VL9D |
| 13 | project=ios/Orgstar.xcodeproj |
| 14 | |
| 15 | if [ "$publish" != 0 ]; then |
| 16 | [ -z "$(git status --porcelain)" ] || { echo "The working tree has changes." >&2; exit 1; } |
| 17 | [ "$(git branch --show-current)" = main ] || { echo "Release from main." >&2; exit 1; } |
| 18 | fi |
| 19 | |
| 20 | version="$(sed -n 's/.*MARKETING_VERSION = \(.*\);/\1/p' "$project/project.pbxproj" | sort -u)" |
| 21 | [ "$(printf '%s\n' "$version" | wc -l | tr -d ' ')" = 1 ] || { echo "The targets' MARKETING_VERSION differ: $version" >&2; exit 1; } |
| 22 | build="$(git rev-list --count HEAD)" |
| 23 | |
| 24 | out=.build/ios-release |
| 25 | rm -rf "${out:?}" |
| 26 | mkdir -p "$out" |
| 27 | archive="$out/orgstar.xcarchive" |
| 28 | # xcodebuild rewrites the project file in its own key order; the copy puts it back as it was. |
| 29 | cp "$project/project.pbxproj" "$out/project.pbxproj" |
| 30 | trap 'cp "$out/project.pbxproj" "$project/project.pbxproj"' EXIT |
| 31 | xcodebuild archive -project "$project" -scheme "Orgstar iOS" -configuration Release \ |
| 32 | -destination 'generic/platform=iOS' -archivePath "$archive" -allowProvisioningUpdates -quiet \ |
| 33 | CURRENT_PROJECT_VERSION="$build" |
| 34 | |
| 35 | if [ "$publish" = 0 ]; then destination=export; else destination=upload; fi |
| 36 | cat > "$out/ExportOptions.plist" <<PLIST |
| 37 | <?xml version="1.0" encoding="UTF-8"?> |
| 38 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 39 | <plist version="1.0"> |
| 40 | <dict> |
| 41 | <key>method</key> |
| 42 | <string>app-store-connect</string> |
| 43 | <key>destination</key> |
| 44 | <string>$destination</string> |
| 45 | <key>teamID</key> |
| 46 | <string>$team</string> |
| 47 | <key>signingStyle</key> |
| 48 | <string>automatic</string> |
| 49 | <key>manageAppVersionAndBuildNumber</key> |
| 50 | <false/> |
| 51 | <key>uploadSymbols</key> |
| 52 | <true/> |
| 53 | </dict> |
| 54 | </plist> |
| 55 | PLIST |
| 56 | xcodebuild -exportArchive -archivePath "$archive" -exportOptionsPlist "$out/ExportOptions.plist" \ |
| 57 | -exportPath "$out/export" -allowProvisioningUpdates -quiet |
| 58 | |
| 59 | if [ "$publish" = 0 ]; then |
| 60 | echo "Exported $(ls "$out"/export/*.ipa): $version ($build), not uploaded" |
| 61 | else |
| 62 | echo "Uploaded orgstar $version ($build) to App Store Connect; it shows in TestFlight once processed" |
| 63 | fi |