hex/ios/ci_scripts/ci_post_clone.sh
Ryan Vogel fe1298535a iOS feedback: ship the report key in Feedback.xcconfig
The key only came from a gitignored local file or an Xcode Cloud secret that
doesn't exist, so a TestFlight build would have had no Send feedback row.
Bellhop report keys are publishable and safe to ship inside an app, and
Android keeps its key in android/gradle.properties, so:

- HEXMobile/Feedback.xcconfig now sets BELLHOP_REPORT_KEY. The optional
  include of Feedback.local.xcconfig stays after it, so a local file or
  ci_post_clone.sh (from an Xcode Cloud BELLHOP_REPORT_KEY secret, if one
  is ever set) overrides it, for a rotation. Still no key in Swift; it
  reaches the app as Info.plist's BellhopReportKey.
- ci_post_clone.sh and the docs say so; rotation: new key, revoke the old
  in Bellhop › Settings › Report keys, change the xcconfig, ship a build.
- FeedbackSender logs "feedback sent as #<number>" (notice, public), so a
  Release build's send can be traced to its issue.

Verified from a clean tree of this commit (git archive, no local override)
on the Studio: a Release simulator build's Info.plist carries the key, the
app shows Send feedback on Home and a send through the form got 201.
2026-11-23 15:52:49 -05:00

34 lines
1.4 KiB
Shell
Executable file

#!/bin/sh
set -eu
# The Xcode project is generated; the full dependency graph is checked in.
if [ -n "${CI_PRIMARY_REPOSITORY_PATH:-}" ]; then
cd "$CI_PRIMARY_REPOSITORY_PATH/ios"
else
cd "$(dirname "$0")/.."
fi
command -v xcodegen >/dev/null || brew install xcodegen
# An App Store build is tagged ios-beta-appstore-<version> (e.g. ios-beta-appstore-0.2.1):
# it is stamped with that version, while the repo and TestFlight stay on project.yml's.
case "${CI_TAG:-}" in
ios-beta-appstore-*)
version="${CI_TAG#ios-beta-appstore-}"
case "$version" in
*[!0-9.]* | "" | .* | *.) echo "Bad App Store version in tag: $CI_TAG" >&2; exit 1 ;;
esac
sed -i '' -E "s/^( +MARKETING_VERSION: ).*/\1$version/" project.yml
grep -n 'MARKETING_VERSION' project.yml
;;
esac
scripts/fetch-cleanup-model.sh
# Send feedback's Bellhop report key is set in HEXMobile/Feedback.xcconfig. An Xcode Cloud
# BELLHOP_REPORT_KEY secret, if one is ever set (say, mid-rotation), overrides it.
if [ -n "${BELLHOP_REPORT_KEY:-}" ]; then
printf 'BELLHOP_REPORT_KEY = %s\n' "$BELLHOP_REPORT_KEY" > HEXMobile/Feedback.local.xcconfig
fi
xcodegen generate
pins=HEXMobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
mkdir -p "$pins"
cp Package.resolved "$pins/Package.resolved"
xcodebuild -resolvePackageDependencies -project HEXMobile.xcodeproj -scheme HEXMobile \
-disableAutomaticPackageResolution -onlyUsePackageVersionsFromResolvedFile