forked from GitJournal/GitJournal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_ios.sh
executable file
·65 lines (47 loc) · 1.73 KB
/
build_ios.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
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2019-2021 Vishesh Handa <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
set -eo pipefail
cd "$(dirname "$0")"
cd ../
flutter pub get
# Download the required libraries
export LIBS_URL="https://github.com/GitJournal/ios-libraries/releases/download/v1.1/libs.zip"
if [ ! -d "ios/libs" ]; then
echo "Downloading Libs"
wget -q "$LIBS_URL"
cd ios
unzip -q ../libs.zip
cd -
rm libs.zip
fi
# Place gj_common
if [ ! -L "gj_common" ]; then
echo "=> gj_common doesn't exist. Cloning"
git clone https://github.com/GitJournal/git_bindings.git
ln -s git_bindings/gj_common gj_common
fi
BUILD_NUM=$(git rev-list --count HEAD)
echo "Build Number: $BUILD_NUM"
BUILD_NAME=$(cat pubspec.yaml | grep version | awk '{ print $2 }' | awk -F "+" '{ print $1 }')
echo "Build Name: $BUILD_NAME"
# I cannot figure out why the flutter replace isn't working for the ShareExtension
if ! command -v which gsed &>/dev/null; then
echo "gsed could not be found"
sed -i "s|\$(FLUTTER_BUILD_NAME)|$BUILD_NAME|" ios/ShareExtension/Info.plist
sed -i "s|\$(FLUTTER_BUILD_NUMBER)|$BUILD_NUM|" ios/ShareExtension/Info.plist
else
gsed -i "s|\$(FLUTTER_BUILD_NAME)|$BUILD_NAME|" ios/ShareExtension/Info.plist
gsed -i "s|\$(FLUTTER_BUILD_NUMBER)|$BUILD_NUM|" ios/ShareExtension/Info.plist
fi
xcodebuild -version
flutter build ios --release --no-codesign --build-number="$BUILD_NUM" --build-name="$BUILD_NAME" --dart-define=INSTALL_SOURCE=appstore
cd ios
export FASTLANE_PASSWORD=$(cat keys/fastlane_password)
echo "Updating fastlane ..."
bundle exec fastlane --version
bundle update fastlane
bundle exec fastlane --version
echo "fastlane release ..."
bundle exec fastlane release