release.sh: add mac/all modes for the Workouts Mac target

This commit is contained in:
2026-07-16 20:48:54 -04:00
parent 04ab7ed005
commit d24d0c3317
2 changed files with 91 additions and 33 deletions
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- TestFlight / App Store distribution for the macOS target. -->
<key>method</key>
<string>app-store-connect</string>
<key>teamID</key>
<string>C32Z8JNLG6</string>
<!-- destination=upload makes -exportArchive push the build straight to
App Store Connect instead of writing a local .pkg. -->
<key>destination</key>
<string>upload</string>
<key>signingStyle</key>
<string>automatic</string>
<key>uploadSymbols</key>
<true/>
<key>stripSwiftSymbols</key>
<true/>
<key>manageAppVersionAndBuildNumber</key>
<false/>
</dict>
</plist>
+68 -33
View File
@@ -1,16 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# release.sh — archive Workouts (iOS app with the embedded watch app) and upload # release.sh — archive Workouts and upload to TestFlight / App Store Connect.
# to TestFlight / App Store Connect. No third-party tooling: pure xcodebuild + the
# App Store Connect API key. Credentials live in .env.release (gitignored); see
# .env.release.example.
# #
# What it does: # Usage: Scripts/release.sh [ios|mac|all] (default: ios)
#
# No third-party tooling: pure xcodebuild + the App Store Connect API key.
# Credentials live in .env.release (gitignored); see .env.release.example.
#
# What it does, per platform:
# 1. Regenerates the Xcode project with XcodeGen. # 1. Regenerates the Xcode project with XcodeGen.
# 2. Stamps CFBundleVersion (CURRENT_PROJECT_VERSION) with the git commit count # 2. xcodebuild archive (the watch app rides along in the iOS archive).
# for both the iOS app and the embedded watch app. # CFBundleVersion is stamped by the update_build_info.sh post-build phase,
# 3. xcodebuild archive (the watch app rides along in the same archive) # platform-partitioned: iOS/watchOS even (commits*2), macOS odd (commits*2+1)
# 4. xcodebuild -exportArchive with destination=upload -> App Store Connect. # — both platforms share one ASC build-number space.
# 3. xcodebuild -exportArchive with destination=upload -> App Store Connect.
# #
set -euo pipefail set -euo pipefail
@@ -19,8 +22,8 @@ ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$ROOT" cd "$ROOT"
PROJECT="Workouts.xcodeproj" PROJECT="Workouts.xcodeproj"
SCHEME="Workouts"
BUILD_DIR="$ROOT/build" BUILD_DIR="$ROOT/build"
PLATFORM="${1:-ios}"
# ---- credentials ------------------------------------------------------------ # ---- credentials ------------------------------------------------------------
ENV_FILE="$ROOT/.env.release" ENV_FILE="$ROOT/.env.release"
@@ -49,38 +52,70 @@ fi
# ---- versioning ------------------------------------------------------------- # ---- versioning -------------------------------------------------------------
BUILD_NUMBER="$(git rev-list HEAD --count)" BUILD_NUMBER="$(git rev-list HEAD --count)"
MARKETING_VERSION="$(grep -m1 'MARKETING_VERSION:' project.yml | sed -E 's/.*"([^"]+)".*/\1/')" MARKETING_VERSION="$(grep -m1 'MARKETING_VERSION:' project.yml | sed -E 's/.*"([^"]+)".*/\1/')"
echo "📦 Version $MARKETING_VERSION (build $BUILD_NUMBER)" echo "📦 Version $MARKETING_VERSION — iOS build $((BUILD_NUMBER * 2)), macOS build $((BUILD_NUMBER * 2 + 1))"
mkdir -p "$BUILD_DIR" mkdir -p "$BUILD_DIR"
ARCHIVE="$BUILD_DIR/Workouts.xcarchive"
EXPORT="$BUILD_DIR/Workouts-export"
rm -rf "$ARCHIVE" "$EXPORT"
echo "🛠 Archiving (iOS app + embedded watch app) ..." # ---- per-platform archive + upload ------------------------------------------
xcodebuild archive \ # args: <scheme> <generic destination> <ExportOptions plist>
-project "$PROJECT" \ archive_and_upload() {
-scheme "$SCHEME" \ local scheme="$1" destination="$2" export_plist="$3"
-configuration Release \ local archive_path="$BUILD_DIR/$scheme.xcarchive"
-destination 'generic/platform=iOS' \ local export_path="$BUILD_DIR/$scheme-export"
-archivePath "$ARCHIVE" \
CURRENT_PROJECT_VERSION="$BUILD_NUMBER" \
CODE_SIGN_STYLE=Automatic \
DEVELOPMENT_TEAM="$APPLE_TEAM_ID" \
"${AUTH[@]}"
echo "🚀 Exporting + uploading to App Store Connect ..." echo ""
xcodebuild -exportArchive \ echo "──────── $scheme ────────"
-archivePath "$ARCHIVE" \
-exportPath "$EXPORT" \ rm -rf "$archive_path" "$export_path"
-exportOptionsPlist "$SCRIPT_DIR/ExportOptions-iOS.plist" \
"${AUTH[@]}" echo "🛠 Archiving $scheme ..."
xcodebuild archive \
-project "$PROJECT" \
-scheme "$scheme" \
-configuration Release \
-destination "$destination" \
-archivePath "$archive_path" \
CODE_SIGN_STYLE=Automatic \
DEVELOPMENT_TEAM="$APPLE_TEAM_ID" \
"${AUTH[@]}"
echo "🚀 Exporting + uploading $scheme to App Store Connect ..."
xcodebuild -exportArchive \
-archivePath "$archive_path" \
-exportPath "$export_path" \
-exportOptionsPlist "$export_plist" \
"${AUTH[@]}"
case "$scheme" in
*Mac) local plat_build=$((BUILD_NUMBER * 2 + 1)) ;;
*) local plat_build=$((BUILD_NUMBER * 2)) ;;
esac
echo "$scheme uploaded (build $plat_build)."
}
do_ios() {
archive_and_upload "Workouts" "generic/platform=iOS" \
"$SCRIPT_DIR/ExportOptions-iOS.plist"
}
do_mac() {
archive_and_upload "Workouts Mac" "generic/platform=macOS" \
"$SCRIPT_DIR/ExportOptions-macOS.plist"
}
case "$PLATFORM" in
ios) do_ios ;;
mac|macos) do_mac ;;
all) do_ios; do_mac ;;
*) echo "Usage: Scripts/release.sh [ios|mac|all]"; exit 1 ;;
esac
echo "" echo ""
echo "✅ Uploaded build $BUILD_NUMBER. Appears in App Store Connect > TestFlight after processing (~515 min)." echo "🎉 Done. Builds appear in App Store Connect > TestFlight after processing (~515 min)."
echo "" echo ""
echo "➡️ Push metadata, then stage/submit for review with the canonical scripts" echo "➡️ Push metadata, then stage/submit for review with the canonical scripts"
echo " (apps sit as siblings of indie-skills under ~/Documents/indie; --bundle" echo " (apps sit as siblings of indie-skills under ~/Documents/indie; --bundle"
echo " and --version are required flags — there are no per-app defaults):" echo " and --version are required flags; pass --platform macos for the Mac listing):"
echo "" echo ""
echo " set -a; source .env.release; set +a; swift ../indie-skills/skills/appstore-publish/scripts/asc-metadata.swift --bundle dev.rzen.indie.Workouts --version $MARKETING_VERSION --dry-run" echo " set -a; source .env.release; set +a; swift ../indie-skills/skills/appstore-publish/scripts/asc-metadata.swift --bundle dev.rzen.indie.Workouts --version $MARKETING_VERSION --dry-run"
echo " set -a; source .env.release; set +a; swift ../indie-skills/skills/appstore-publish/scripts/asc-metadata.swift --bundle dev.rzen.indie.Workouts --version $MARKETING_VERSION" echo " set -a; source .env.release; set +a; swift ../indie-skills/skills/appstore-publish/scripts/asc-metadata.swift --bundle dev.rzen.indie.Workouts --version $MARKETING_VERSION"