commit a94d7b77613728bb9b4a77ef5c1c89434812abf6
parent 2b98cca2466f4b78e34f8d7535615809db558b45
Author: Michael Camilleri <[email protected]>
Date: Tue, 31 Mar 2026 16:52:30 +0900
Update scripts to work without login keychain being unlocked
Diffstat:
4 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/Scripts/publish-ios.sh b/Scripts/publish-ios.sh
@@ -5,7 +5,7 @@ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SECRETS="$REPO_ROOT/.asc/secrets.sh"
if [[ ! -f "$SECRETS" ]]; then
- echo "Error: $SECRETS not found. See .asc/secrets.sh.example for the required format."
+ echo "Error: $SECRETS not found. See Scripts/secrets.sh.example for the required format."
exit 1
fi
@@ -16,7 +16,7 @@ ARCHIVE_PATH="/tmp/Listless-latest.xcarchive"
EXPORT_PATH="/tmp/Listless-export"
EXPORT_PLIST="/tmp/Listless-ExportOptions.plist"
IPA_PATH="$EXPORT_PATH/Listless iOS.ipa"
-DEV_P12="$REPO_ROOT/.asc/ios-signing/dev.p12"
+DEV_P12="$REPO_ROOT/.asc/dev.p12"
DIST_P12="$REPO_ROOT/.asc/ios-signing/dist-headless.p12"
TMP_KEYCHAIN="$REPO_ROOT/.asc/build.keychain-db"
diff --git a/Scripts/publish-macos.sh b/Scripts/publish-macos.sh
@@ -5,7 +5,7 @@ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SECRETS="$REPO_ROOT/.asc/secrets.sh"
if [[ ! -f "$SECRETS" ]]; then
- echo "Error: $SECRETS not found. See .asc/secrets.sh.example for the required format."
+ echo "Error: $SECRETS not found. See Scripts/secrets.sh.example for the required format."
exit 1
fi
@@ -18,7 +18,7 @@ EXPORT_PATH="/tmp/Listless-mac-export"
EXPORT_PLIST="/tmp/Listless-mac-ExportOptions.plist"
PKG_PATH="$EXPORT_PATH/Listless.pkg"
SIGNING_DIR="$REPO_ROOT/.asc/macos-signing"
-DEV_P12="$REPO_ROOT/.asc/ios-signing/dev.p12"
+DEV_P12="$REPO_ROOT/.asc/dev.p12"
APP_P12="$SIGNING_DIR/app-headless.p12"
INSTALLER_P12="$SIGNING_DIR/installer-headless.p12"
TMP_KEYCHAIN="$REPO_ROOT/.asc/build.keychain-db"
diff --git a/Scripts/secrets.sh.example b/Scripts/secrets.sh.example
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Secrets and signing configuration — kept out of version control.
+# Copy this file to .asc/secrets.sh and fill in the values.
+
+TEAM_ID="your-team-id"
+KEY_ID="your-api-key-id"
+ISSUER_ID="your-issuer-id"
+DEV_P12_PASS="your-dev-p12-password"
+DIST_P12_PASS="your-dist-p12-password"
+TMP_KEYCHAIN_PASS="your-tmp-keychain-password"
diff --git a/Scripts/test-macos-ui.sh b/Scripts/test-macos-ui.sh
@@ -1,6 +1,39 @@
#!/bin/bash
set -euo pipefail
+REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+SECRETS="$REPO_ROOT/.asc/secrets.sh"
+
+if [[ ! -f "$SECRETS" ]]; then
+ echo "Error: $SECRETS not found. See Scripts/secrets.sh.example for the required format."
+ exit 1
+fi
+
+source "$SECRETS"
+
+DEV_P12="$REPO_ROOT/.asc/dev.p12"
+TMP_KEYCHAIN="$REPO_ROOT/.asc/build.keychain-db"
+
+echo "==> Setting up temporary keychain..."
+security delete-keychain "$TMP_KEYCHAIN" 2>/dev/null || true
+security create-keychain -p "$TMP_KEYCHAIN_PASS" "$TMP_KEYCHAIN"
+security unlock-keychain -p "$TMP_KEYCHAIN_PASS" "$TMP_KEYCHAIN"
+security set-keychain-settings -lut 21600 "$TMP_KEYCHAIN"
+security import "$DEV_P12" -k "$TMP_KEYCHAIN" -P "$DEV_P12_PASS" \
+ -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
+security set-key-partition-list -S apple-tool:,apple:,codesign:,productbuild: \
+ -s -k "$TMP_KEYCHAIN_PASS" "$TMP_KEYCHAIN"
+security list-keychains -d user -s "$TMP_KEYCHAIN" ~/Library/Keychains/login.keychain-db
+
+cleanup_keychain() {
+ echo "==> Restoring keychain search list..."
+ security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
+ security default-keychain -d user -s ~/Library/Keychains/login.keychain-db
+ security delete-keychain "$TMP_KEYCHAIN" 2>/dev/null || true
+}
+trap cleanup_keychain EXIT
+
+echo "==> Running macOS UI tests..."
xcodebuild test \
-scheme "Listless macOS" \
-destination 'platform=macOS' \