-
Notifications
You must be signed in to change notification settings - Fork 70
/
build.sh
executable file
·36 lines (21 loc) · 1.16 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
APP_NAME="Thor"
# build ARM
xcodebuild -workspace "$APP_NAME.xcworkspace" -scheme "$APP_NAME" -archivePath "${APP_NAME}_arm64" -arch arm64 archive
# build Intel
xcodebuild -workspace "$APP_NAME.xcworkspace" -scheme "$APP_NAME" -archivePath "${APP_NAME}_x86_64" -arch x86_64 archive
# export ARM
xcodebuild -exportArchive -archivePath "${APP_NAME}_arm64.xcarchive" -exportPath ./arm64 -exportOptionsPlist ExportOptions.plist
# export Intel
xcodebuild -exportArchive -archivePath "${APP_NAME}_x86_64.xcarchive" -exportPath ./x86_64 -exportOptionsPlist ExportOptions.plist
# lipo combine
lipo -create ./arm64/"$APP_NAME".app/Contents/MacOS/"$APP_NAME" ./x86_64/"$APP_NAME".app/Contents/MacOS/"$APP_NAME" -output ./arm64/"$APP_NAME".app/Contents/MacOS/"$APP_NAME"
sleep 3
# Archive
VERSION=`mdls -name kMDItemVersion ./arm64/"$APP_NAME".app | grep -o '\d*\.\d*\.\d*'`
cd ./arm64 && zip -r "$APP_NAME".zip "$APP_NAME".app && cd ..
mv ./arm64/"$APP_NAME".zip Releases/"$APP_NAME"_"$VERSION".zip
# Sparkle
./Pods/Sparkle/bin/generate_appcast ./Releases
# Clean
rm -rf "${APP_NAME}_arm64.xcarchive" "${APP_NAME}_x86_64.xcarchive" ./arm64 ./x86_64 Releases/.tmp