forked from jcs/endless
-
Notifications
You must be signed in to change notification settings - Fork 6
/
generate_and_upload_store_assets.sh
executable file
·68 lines (53 loc) · 2.21 KB
/
generate_and_upload_store_assets.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
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
#
# Copyright (c) 2017, Psiphon Inc.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#!/bin/bash -u
BASE_DIR=$(cd "$(dirname "$0")" ; pwd -P)
iTMSTransporter="/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter"
cd "${BASE_DIR}"
# Check that the necessary tools are installed
command -v python
if [[ $? != 0 ]]; then
echo "python could not be found. Exiting..."
exit 1
fi
command -v iTMSTransporter
if [[ $? != 0 ]]; then
echo "iTMSTransporter could not be found. Exiting..."
exit 1
fi
echo "Generating itmsp package..."
# Check that release version numbers match (CFBundleShortVersionString)
VERSION_STRING=$(python info_plist.py -p ./Endless/Info.plist -o short_version)
python store_assets_itmsp.py --provider "${PROVIDER}" --team_id "${TEAM_ID}" --vendor_id "${VENDOR_ID}" --whats_new "${WHATS_NEW}" --version_string "${VERSION_STRING}" --output_path "${BASE_DIR}"
if [[ $? != 0 ]]; then
echo "Failed to generate itmsp package. Exiting..."
exit 1
fi
ITMSP="${BASE_DIR}/${VENDOR_ID}.itmsp"
"${iTMSTransporter}" -m verify -f "${ITMSP}" -u "${ITUNES_CONNECT_USERNAME}" -p "${ITUNES_CONNECT_PASSWORD}"
if [[ $? != 0 ]]; then
echo "${ITMSP} failed validation. Exiting..."
exit 1
fi
echo "Successfully generated itmsp package ${ITMSP}"
echo "Uploading itmsp package to iTunes Connect..."
"${iTMSTransporter}" -m upload -f "${ITMSP}" -u "${ITUNES_CONNECT_USERNAME}" -p "${ITUNES_CONNECT_PASSWORD}"
if [[ $? != 0 ]]; then
echo "Failed to upload ${ITMSP} to iTunes Connect. Exiting..."
exit 1
fi
echo "Successfully uploaded ${ITMSP} to iTunes Connect."