TestFlight release script for the iOS app !354

merged merged by cmc on 2026-10-16 02:19 UTC · krz/orgstar:release-ios into main

3 files changed, +74 −3

Layout: unified · split

CONTRIBUTING.org +9 −2
@@ -4,8 +4,8 @@
44
55Design phases 1–7 are built. The Mac app is released as a notarized DMG and a Homebrew
66cask, with Sparkle updates. The iOS and watchOS apps build from the Xcode project for the
7Simulator and for a device signed with your own team; device signing and TestFlight for
8releases are not set up (issue 8). Owed: the M1 Air gate run (issue 2) and the VoiceOver
7Simulator 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
99passes on the Mac and iOS (issues 3 and 4).
1010
1111=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
6969update window shows, and =ORGSTAR_RELEASE_NOTES= to a Markdown file for the gitbay
7070release. Without them both get the one-line platform note.
7171
72=scripts/release-ios.sh= then archives the =Orgstar iOS= scheme, with its extensions and the
73watch app, and uploads it to App Store Connect for TestFlight. It signs automatically with the
74team's distribution certificate through the Apple ID signed in to Xcode (Xcode ▸ Settings ▸
75Accounts), so it needs no key of its own. The version is the project's =MARKETING_VERSION=;
76the 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
7279* App Store header
7380
7481=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
5656[[https://gitbay.org/krz/orgstar/releases][releases page]]. The iPhone and iPad app (iOS 26
5757or later) is built from source with Xcode; see [[file:docs/manual/install.org]].
5858
59To build from source or contribute, see [[file:CONTRIBUTING.org]].
59To build from source, contribute or release (the Mac app and TestFlight), see
60[[file:CONTRIBUTING.org]].
6061
6162License: 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
8set -eu
9
10cd "$(dirname "$0")/.."
11publish="${ORGSTAR_PUBLISH:-1}"
12team=ZCNAX3VL9D
13project=ios/Orgstar.xcodeproj
14
15if [ "$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; }
18fi
19
20version="$(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; }
22build="$(git rev-list --count HEAD)"
23
24out=.build/ios-release
25rm -rf "${out:?}"
26mkdir -p "$out"
27archive="$out/orgstar.xcarchive"
28# xcodebuild rewrites the project file in its own key order; the copy puts it back as it was.
29cp "$project/project.pbxproj" "$out/project.pbxproj"
30trap 'cp "$out/project.pbxproj" "$project/project.pbxproj"' EXIT
31xcodebuild archive -project "$project" -scheme "Orgstar iOS" -configuration Release \
32 -destination 'generic/platform=iOS' -archivePath "$archive" -allowProvisioningUpdates -quiet \
33 CURRENT_PROJECT_VERSION="$build"
34
35if [ "$publish" = 0 ]; then destination=export; else destination=upload; fi
36cat > "$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>
55PLIST
56xcodebuild -exportArchive -archivePath "$archive" -exportOptionsPlist "$out/ExportOptions.plist" \
57 -exportPath "$out/export" -allowProvisioningUpdates -quiet
58
59if [ "$publish" = 0 ]; then
60 echo "Exported $(ls "$out"/export/*.ipa): $version ($build), not uploaded"
61else
62 echo "Uploaded orgstar $version ($build) to App Store Connect; it shows in TestFlight once processed"
63fi