Use appstore-kit for the iOS release script and header !376

merged merged by cmc on 2026-11-07 14:24 UTC · krz/orgstar:appstore-kit into main

4 files changed, +17 −102

Layout: unified · split

CONTRIBUTING.org +4 −2
@@ -75,8 +75,10 @@ team's distribution certificate through the Apple ID signed in to Xcode (Xcode
75Accounts), so it needs no key of its own. The version is the project's =MARKETING_VERSION=; 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. 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. 77=ORGSTAR_PUBLISH=0= archives and exports the =.ipa= to =.build/ios-release= without uploading.
78The script sources =release-ios.sh= from appstore-kit, checked out beside this repository or
79at =$APPSTORE_KIT=.
78 80
79* App Store header 81* App Store header
80 82
81=ios/AppStore/header.html= renders the product page headers; the commands are in the 83=ios/AppStore/header.conf= sets the product page header's background and screenshots;
82comment at the top of the file. 84appstore-kit's =render-header.sh ios/AppStore= renders it.
ios/AppStore/header.conf added +6
@@ -0,0 +1,6 @@
1# Product page header, after the krz.sh hero: three iPhones fanned over the app's green.
2# Render with appstore-kit: ../appstore-kit/render-header.sh ios/AppStore
3background='radial-gradient(ellipse 55% 75% at 50% 30%, #7a9845 0%, #56722c 35%, #33451a 70%, #182109 100%)'
4left=02-reader
5center=01-agenda
6right=04-tables
ios/AppStore/header.html deleted −42
@@ -1,42 +0,0 @@
1<!doctype html>
2<!-- Product page header, after the krz.sh hero: three iPhones fanned over the app's green.
3 header.html renders the 21:9 header (3840x1646), header.html#wide the 16:9 one (5244x2950),
4 with headless Chromium, then the alpha channel is removed:
5 Chromium --headless --hide-scrollbars --force-device-scale-factor=1 --window-size=3840,1646 --screenshot=header-21x9.png header.html
6 Chromium --headless --hide-scrollbars --force-device-scale-factor=1 --window-size=5244,2950 --screenshot=header-16x9.png "file://$PWD/header.html#wide"
7 magick header-21x9.png -alpha off PNG24:header-21x9.png -->
8<html>
9<head>
10<meta charset="utf-8">
11<style>
12 :root { --u: 1px; --top: 180px; }
13 * { box-sizing: border-box; }
14 html, body { margin: 0; width: 3840px; height: 1646px; overflow: hidden; }
15 body {
16 position: relative;
17 background:
18 radial-gradient(ellipse 55% 75% at 50% 30%, #7a9845 0%, #56722c 35%, #33451a 70%, #182109 100%);
19 }
20 .iphone {
21 position: absolute; left: 50%; top: var(--top);
22 width: calc(860 * var(--u)); height: calc(1868 * var(--u));
23 padding: calc(24 * var(--u)); border-radius: calc(140 * var(--u)); background: #0c0c12;
24 box-shadow: 0 calc(50 * var(--u)) calc(120 * var(--u)) rgba(0, 0, 0, 0.5);
25 }
26 .iphone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: calc(116 * var(--u)); }
27 .center { transform: translateX(-50%); z-index: 2; }
28 .left { transform: translate(calc(-50% - 760 * var(--u)), calc(120 * var(--u))) rotate(-8deg); }
29 .right { transform: translate(calc(-50% + 760 * var(--u)), calc(120 * var(--u))) rotate(8deg); }
30
31 /* 16:9, 5244x2950. */
32 html.wide { --u: 1.6px; --top: 420px; }
33 html.wide, .wide body { width: 5244px; height: 2950px; }
34</style>
35<script>if (location.hash === "#wide") document.documentElement.className = "wide";</script>
36</head>
37<body>
38 <div class="iphone left"><img src="screenshots/iphone-6.9/02-reader.png"></div>
39 <div class="iphone right"><img src="screenshots/iphone-6.9/04-tables.png"></div>
40 <div class="iphone center"><img src="screenshots/iphone-6.9/01-agenda.png"></div>
41</body>
42</html>
scripts/release-ios.sh +7 −58
@@ -1,63 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2# Archives the iOS app (with its extensions and the watch app) and uploads it to App Store 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 3# Connect for TestFlight. The version is the project's MARKETING_VERSION; the build number is the
4# the Apple ID signed in to Xcode. The version is the project's MARKETING_VERSION; the build 4# commit count, as the Mac release's is. Run after scripts/release-mac.sh. The work is done by
5# number is the commit count, as the Mac release's is. Run after scripts/release-mac.sh. 5# appstore-kit, checked out beside this repository or at $APPSTORE_KIT.
6# Usage: scripts/release-ios.sh 6# Usage: scripts/release-ios.sh
7# ORGSTAR_PUBLISH 0 archives and exports the .ipa to .build/ios-release without uploading 7# ORGSTAR_PUBLISH 0 archives and exports the .ipa to .build/ios-release without uploading
8set -eu 8PUBLISH="${ORGSTAR_PUBLISH:-1}"
9 9name=orgstar
10cd "$(dirname "$0")/.."
11publish="${ORGSTAR_PUBLISH:-1}"
12team=ZCNAX3VL9D
13project=ios/Orgstar.xcodeproj 10project=ios/Orgstar.xcodeproj
14 11scheme="Orgstar iOS"
15if [ "$publish" != 0 ]; then 12. "${APPSTORE_KIT:-$(dirname "$0")/../../appstore-kit}/release-ios.sh"
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