2026-10-11 23:23:20 +00:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
test -n "${DEVELOPMENT_TEAM:-}" || {
|
|
|
|
|
|
echo "请设置 DEVELOPMENT_TEAM(Apple Developer Team ID)。" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
2026-10-27 02:46:08 +00:00
|
|
|
|
|
|
|
|
|
|
source_version=$(awk '
|
|
|
|
|
|
$1 == "MARKETING_VERSION:" {
|
|
|
|
|
|
value = $2
|
|
|
|
|
|
sub(/^"/, "", value)
|
|
|
|
|
|
sub(/"$/, "", value)
|
|
|
|
|
|
if (value !~ /^[0-9]+\.[0-9]+\.[0-9]+$/ || seen++) exit 1
|
|
|
|
|
|
version = value
|
|
|
|
|
|
}
|
|
|
|
|
|
END {
|
|
|
|
|
|
if (seen != 1 || version == "") exit 1
|
|
|
|
|
|
print version
|
|
|
|
|
|
}
|
|
|
|
|
|
' project.yml) || {
|
|
|
|
|
|
echo "project.yml 必须包含唯一的数字三段 MARKETING_VERSION。" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
archive_path="build/UCVL-Zonghengjia-${source_version}.xcarchive"
|
|
|
|
|
|
simulator_destination=${SIMULATOR_DESTINATION:-'platform=iOS Simulator,name=iPhone 16 Pro'}
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${EXPORT_OPTIONS_PLIST:-}" ]; then
|
|
|
|
|
|
test -f "$EXPORT_OPTIONS_PLIST" && test -r "$EXPORT_OPTIONS_PLIST" || {
|
|
|
|
|
|
echo "EXPORT_OPTIONS_PLIST 必须指定可读的发布选项文件。" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
plutil -lint -- "$EXPORT_OPTIONS_PLIST" >/dev/null || {
|
|
|
|
|
|
echo "EXPORT_OPTIONS_PLIST 不是有效的 plist 文件。" >&2
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2026-10-11 23:23:20 +00:00
|
|
|
|
./Scripts/fetch-libxray.sh
|
|
|
|
|
|
./Scripts/generate-project.sh
|
|
|
|
|
|
xcodebuild \
|
|
|
|
|
|
-project UCVLZonghengjia.xcodeproj \
|
|
|
|
|
|
-scheme UCVLZonghengjia \
|
2026-10-27 02:46:08 +00:00
|
|
|
|
-destination "$simulator_destination" \
|
2026-10-11 23:23:20 +00:00
|
|
|
|
DEVELOPMENT_TEAM="$DEVELOPMENT_TEAM" \
|
|
|
|
|
|
test
|
|
|
|
|
|
xcodebuild \
|
|
|
|
|
|
-project UCVLZonghengjia.xcodeproj \
|
|
|
|
|
|
-scheme UCVLZonghengjia \
|
|
|
|
|
|
-configuration Release \
|
|
|
|
|
|
-destination 'generic/platform=iOS' \
|
2026-10-27 02:46:08 +00:00
|
|
|
|
-archivePath "$archive_path" \
|
2026-10-11 23:23:20 +00:00
|
|
|
|
DEVELOPMENT_TEAM="$DEVELOPMENT_TEAM" \
|
|
|
|
|
|
archive
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${EXPORT_OPTIONS_PLIST:-}" ]; then
|
|
|
|
|
|
xcodebuild \
|
|
|
|
|
|
-exportArchive \
|
2026-10-27 02:46:08 +00:00
|
|
|
|
-archivePath "$archive_path" \
|
2026-10-11 23:23:20 +00:00
|
|
|
|
-exportPath build/export \
|
|
|
|
|
|
-exportOptionsPlist "$EXPORT_OPTIONS_PLIST"
|
|
|
|
|
|
fi
|