iOS signed builds use build.keychain on WHITE-M1AIR (no p12 temp keychain), like Eze
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6cb8593b3d
commit
fdd680bbe9
2 files changed
+12
-21
No files matched your search
+10
-19
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
# Builds one Stemify IPA on a Mac. ios/scripts/build-remote.sh runs this on WHITE-M1AIR from DevOps.
|
||||
# build-ipa.sh public build/public/stemify-<v>.ipa org.cdnutter.stemify, ad-hoc signed. Gitea releases (main) + Sideload.
|
||||
# build-ipa.sh public build/public/stemify-<v>.ipa org.cdnutter.stemify, ad-hoc signed. Gitea releases (main) + iOS Repos /personal.
|
||||
# build-ipa.sh dev build/dev/stemify-<v>-dev.ipa org.cdnutter.stemify-dev, ribbon icon, DEV BUILD banner.
|
||||
# Gitea pre-releases (dev branch) + Sideload Developer.
|
||||
# Gitea pre-releases (dev branch) + iOS Repos /dev.
|
||||
# build-ipa.sh signed build/signed/stemify-<v>-signed.ipa org.cdnutter.stemify, signed with the
|
||||
# personal profile (CarPlay, Siri). Never published anywhere.
|
||||
# signed needs prov/Stemify.mobileprovision (App ID org.cdnutter.stemify), prov/key.p12 and P12_PASS.
|
||||
# signed needs prov/Stemify.mobileprovision (App ID org.cdnutter.stemify) and the Apple Development identity in
|
||||
# ~/Library/Keychains/build.keychain-db (password in ~/.config/signing/keychain_pass).
|
||||
# prov/StemifyWidgets.mobileprovision (org.cdnutter.stemify.widgets) is optional, without it the widgets are left out.
|
||||
# build/work is scratch and is wiped each run.
|
||||
set -euo pipefail
|
||||
@@ -30,10 +31,10 @@ BN=$(sed -nE 's/^ *CURRENT_PROJECT_VERSION: "(.*)"/\1/p' project.yml)
|
||||
# "0.9.0" -> 0.9.0, "1.0 RC 1" -> 1.0-rc1, used in file names and release tags.
|
||||
VERSION=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g')
|
||||
IPA=$B/$MODE/stemify-$VERSION$SUFFIX.ipa
|
||||
KC=$HOME/Library/Keychains/build.keychain-db
|
||||
|
||||
if [ "$MODE" = signed ]; then
|
||||
for f in prov/Stemify.mobileprovision prov/key.p12; do [ -f $f ] || { echo "missing $f" >&2; exit 1; }; done
|
||||
[ -n "${P12_PASS:-}" ] || { echo "P12_PASS not set" >&2; exit 1; }
|
||||
for f in prov/Stemify.mobileprovision $KC $HOME/.config/signing/keychain_pass; do [ -f $f ] || { echo "missing $f" >&2; exit 1; }; done
|
||||
PROF_ID=$(security cms -D -i prov/Stemify.mobileprovision | plutil -extract Entitlements.application-identifier raw -)
|
||||
[ "${PROF_ID#*.}" = "$APP_ID" ] || { echo "prov/Stemify.mobileprovision is for ${PROF_ID#*.}, need a profile for $APP_ID" >&2; exit 1; }
|
||||
fi
|
||||
@@ -56,31 +57,21 @@ PL
|
||||
codesign -f -s - --entitlements $OUT/group.plist $EXT
|
||||
codesign -f -s - --entitlements $OUT/group.plist $APP
|
||||
else
|
||||
KC=$PWD/$OUT/sign.keychain-db; KP=$(uuidgen)
|
||||
security create-keychain -p "$KP" $KC
|
||||
security set-keychain-settings -lut 3600 $KC
|
||||
security unlock-keychain -p "$KP" $KC
|
||||
security import prov/key.p12 -P "$P12_PASS" -A -t agg -f pkcs12 -k $KC >/dev/null
|
||||
# The dev cert chains to Apple's WWDR G3 intermediate, which a fresh keychain doesn't have.
|
||||
[ -f prov/wwdr.cer ] || curl -fsSL -o prov/wwdr.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
|
||||
security import prov/wwdr.cer -A -k $KC >/dev/null 2>&1 || true
|
||||
security set-key-partition-list -S apple-tool:,apple: -s -k "$KP" $KC >/dev/null
|
||||
security list-keychains -d user -s $KC $(security list-keychains -d user | tr -d '"')
|
||||
security unlock-keychain -p "$(cat $HOME/.config/signing/keychain_pass)" $KC
|
||||
ID=$(security find-identity -v -p codesigning $KC | sed -nE 's/.*"(Apple Development:.*)"/\1/p' | head -1)
|
||||
[ -n "$ID" ] || { echo "no Apple Development identity in $KC" >&2; exit 1; }
|
||||
security cms -D -i prov/Stemify.mobileprovision > $OUT/prov.plist
|
||||
/usr/libexec/PlistBuddy -x -c 'Print :Entitlements' $OUT/prov.plist > $OUT/ent.plist
|
||||
if [ -f prov/StemifyWidgets.mobileprovision ]; then
|
||||
security cms -D -i prov/StemifyWidgets.mobileprovision > $OUT/wprov.plist
|
||||
/usr/libexec/PlistBuddy -x -c 'Print :Entitlements' $OUT/wprov.plist > $OUT/went.plist
|
||||
cp prov/StemifyWidgets.mobileprovision $EXT/embedded.mobileprovision
|
||||
codesign -f -s "$ID" --entitlements $OUT/went.plist --timestamp=none $EXT
|
||||
codesign -f -s "$ID" --keychain $KC --entitlements $OUT/went.plist --timestamp=none $EXT
|
||||
else
|
||||
rm -rf $APP/PlugIns
|
||||
fi
|
||||
cp prov/Stemify.mobileprovision $APP/embedded.mobileprovision
|
||||
codesign -f -s "$ID" --entitlements $OUT/ent.plist --timestamp=none $APP
|
||||
security list-keychains -d user -s $(security list-keychains -d user | tr -d "\"" | grep -v sign.keychain)
|
||||
security delete-keychain $KC
|
||||
codesign -f -s "$ID" --keychain $KC --entitlements $OUT/ent.plist --timestamp=none $APP
|
||||
fi
|
||||
|
||||
rm -f $IPA
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Run from DevOps: syncs ios/ to WHITE-M1AIR, builds there, and pulls the IPAs back into ios/build/<mode>.
|
||||
# build-remote.sh dev build (the usual one): build/dev
|
||||
# build-remote.sh public public build, only when a release is asked for: build/public
|
||||
# build-remote.sh signed personal signed build: build/signed
|
||||
# build-remote.sh signed owner's signed build: build/signed (needs WHITE-M1AIR ~/stemify-build/ios/prov/Stemify.mobileprovision)
|
||||
# build-remote.sh dev signed ... several at once
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
@@ -11,7 +11,7 @@ MODES=${*:-dev}
|
||||
for m in $MODES; do case $m in public|dev|signed) ;; *) echo "usage: $0 [public|dev|signed]..." >&2; exit 1 ;; esac; done
|
||||
rsync -a --exclude build --exclude prov --exclude Stemify.xcodeproj ./ $H:$R/
|
||||
for m in $MODES; do
|
||||
ssh $H "cd $R && P12_PASS=\$(cat prov/cert_pass.txt 2>/dev/null) bash scripts/build-ipa.sh $m"
|
||||
ssh $H "cd $R && bash scripts/build-ipa.sh $m"
|
||||
mkdir -p build/$m && rsync -a $H:$R/build/$m/ build/$m/
|
||||
done
|
||||
ls build/{public,dev,signed}/stemify-$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g')*.ipa 2>/dev/null
|
||||
Reference in new issue
Block a user