-
Notifications
You must be signed in to change notification settings - Fork 3
/
iOS-StoreSubmit.yaml
154 lines (135 loc) · 5.42 KB
/
iOS-StoreSubmit.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
directories:
- AC_SOURCE
- AC_OUTPUT_DIR
steps:
- componentType: appcircle_xcode_select
componentVersion: "1.0.*"
stepName: Xcode Select
enabled: true
onError: $exit
webUrl: https://github.com/appcircleio/appcircle-xcode-select-component
repoUrl: https://github.com/appcircleio/appcircle-xcode-select-component.git
commit: f94a19c
inputs:
- AC_XCODE_LIST_DIR: "$AC_XCODE_LIST_DIR"
- AC_XCODE_VERSION: "$AC_XCODE_VERSION"
outputs:
- XCODE_DEVELOPER_DIR_PATH: "XCODE_DEVELOPER_DIR_PATH"
- componentType: appcircle_custom_script
componentVersion: "1.0.*"
stepName: Custom Script
enabled: true
onError: $exit
webUrl: https://github.com/appcircleio/appcircle-custom-script-component
repoUrl: https://github.com/appcircleio/appcircle-custom-script-component.git
commit: cbea20fd9b7c43c6d1c98390ded12466f15287bf
inputs:
- Execute: "bash"
- Script: |
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
locale
curl -o "./$IPAFileName" -k $IPAFileUrl
#cat "./$IPAFileName"
curl -O https://appcircle-common.s3-eu-west-1.amazonaws.com/apple/iTMSTransporter-2.1.0.pkg
sudo installer -pkg iTMSTransporter-2.1.0.pkg -target /
sudo chown -R $(whoami): /usr/local/itms
if [ $appleStoreSubmitApiType == 0 ] #ApplicationSpecificPasswordConnection
then
mkdir filename.itmsp
mv ./$IPAFileName "filename.itmsp/$IPAFileName"
#stat -f %z "filename.itmsp/$IPAFileName"
fileSize=`stat -f %z "filename.itmsp/$IPAFileName"`
#find -s "filename.itmsp/$IPAFileName" -type f -exec md5 -q {} \;
md5Checksum=`find -s "filename.itmsp/$IPAFileName" -type f -exec md5 -q {} \;`
#echo $md5Checksum
bundleIdentifier=$BundleId
appleId="$AppleId"
dir="/usr/local/itms/bin"
workDir=`pwd`
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > filename.itmsp/metadata.xml
echo "<package xmlns=\"http://apple.com/itunes/importer\" version=\"software5.4\">" >> filename.itmsp/metadata.xml
echo " <software_assets bundle_identifier=\"$bundleIdentifier\" apple_id=\"$appleId\" app_platform=\"ios\">" >> filename.itmsp/metadata.xml
echo " <asset type=\"bundle\">" >> filename.itmsp/metadata.xml
echo " <data_file>" >> filename.itmsp/metadata.xml
echo " <size>$fileSize</size>" >> filename.itmsp/metadata.xml
echo " <file_name>$IPAFileName</file_name>" >> filename.itmsp/metadata.xml
echo " <checksum type=\"md5\">$md5Checksum</checksum>" >> filename.itmsp/metadata.xml
echo " </data_file>" >> filename.itmsp/metadata.xml
echo " </asset>" >> filename.itmsp/metadata.xml
echo " </software_assets>" >> filename.itmsp/metadata.xml
echo "</package>" >> filename.itmsp/metadata.xml
#cat filename.itmsp/metadata.xml
destinationDir=$workDir"/filename.itmsp"
#echo $destinationDir
if [ $StackType == 10 ] #TestFlight
then
#echo $dir/iTMSTransporter -m upload -u "$AppleUserName" -p "$ApplicationSpecificPassword" -f "$destinationDir" -k 100000 -v eXtreme
sudo $dir/iTMSTransporter -m upload -u "$AppleUserName" -p "$ApplicationSpecificPassword" -f "$destinationDir" -k 100000 -v eXtreme
if [ $? -eq 0 ]
then
echo "TestFlight progress succeeded"
exit 0
else
echo "TestFlight progress failed :" >&2
exit 1
fi
fi
if [ $StackType == 12 ] #Release
then
#echo $dir/iTMSTransporter -m upload -u "$AppleUserName" -p "$ApplicationSpecificPassword" -f "$destinationDir" -k 100000 -v eXtreme
sudo $dir/iTMSTransporter -m upload -u "$AppleUserName" -p "$ApplicationSpecificPassword" -f "$destinationDir" -k 100000 -v eXtreme
if [ $? -eq 0 ]
then
echo "Release progress succeeded"
exit 0
else
echo "Release progress failed :" >&2
exit 1
fi
fi
fi
if [ $appleStoreSubmitApiType == 1 ] #AppStoreConnectApiConnection
then
#gem install fastlane -NV
if [[ "$AC_XCODE_VERSION" == "13."* ]];
then
export ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true
fi
bundle init
echo "gem \"fastlane\"">>Gemfile
bundle install
mkdir fastlane
touch fastlane/Appfile
touch fastlane/Fastfile
mv $FastFileConfig "fastlane/Fastfile"
#cat fastlane/Fastfile
mv "$AppStoreConnectApiKey" "$AppStoreConnectApiKeyFileName"
#cat "$AppStoreConnectApiKeyFileName"
if [ $StackType == 10 ]
then
bundle exec fastlane doTestFlight --verbose
if [ $? -eq 0 ]
then
echo "TestFlight progress succeeded"
exit 0
else
echo "TestFlight progress failed :" >&2
exit 1
fi
fi
if [ $StackType == 12 ]
then
bundle exec fastlane doRelease --verbose
if [ $? -eq 0 ]
then
echo "Release progress succeeded"
exit 0
else
echo "Release progress failed :" >&2
exit 1
fi
fi
fi