From e46626572045e474da9a8e17c7d197b7b60889ab Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 26 Apr 2019 11:08:35 +0200 Subject: [PATCH 1/2] Build: Add a sh build script --- Tools/Release/buildRelease.sh | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 Tools/Release/buildRelease.sh diff --git a/Tools/Release/buildRelease.sh b/Tools/Release/buildRelease.sh new file mode 100755 index 000000000..0923ade5b --- /dev/null +++ b/Tools/Release/buildRelease.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +export GEM_HOME=$HOME/.gem +export PATH=$GEM_HOME/bin:$PATH + +if [ ! $# -eq 1 ]; then + echo "Usage: ./buildRelease.sh [tag or branch]" + exit 1 +fi + +if [ ! -n "$APPLE_ID" ]; then + echo "You must set the APPLE_ID env var before calling this script" + echo 'export APPLE_ID="foo.bar@apple.com"' + exit 1 +fi + + +TAG=$1 +BUILD_DIR="build"/$TAG +BUILD_NUMBER=$( date +%Y%m%d%H%M%S ) + + +if [ -e $BUILD_DIR ]; then + echo "Error: Folder ${BUILD_DIR} already exists" + exit 1 +fi + + +# Fastlane update +gem install bundler +bundle install +bundle update + +# Checkout the source to build +mkdir -p $BUILD_DIR +cd $BUILD_DIR +git clone --single-branch --branch $TAG https://github.com/vector-im/riot-ios.git +cd riot-ios + + +# Develop branch special case +if [ "$TAG" = "develop" ]; then + ./use-dev-pods.sh +fi + + +# Build +bundle exec fastlane app_store build_number:$BUILD_NUMBER + +# Check ipa +./checkipa.sh out/Riot.ipa + + +if [ -e out/Riot.ipa ]; then + # Here is the artefact + cp out/Riot.ipa ../../../Riot-$TAG-$BUILD_NUMBER.ipa + + echo "Riot-$TAG-$BUILD_NUMBER.ipa has been successfully built" +fi From 6c3717b969a1ae057406218f650f9d9cfc1129a2 Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 26 Apr 2019 11:30:21 +0200 Subject: [PATCH 2/2] Build: Add a sh build script --- Tools/Release/buildRelease.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/Release/buildRelease.sh b/Tools/Release/buildRelease.sh index 0923ade5b..739fb2c9b 100755 --- a/Tools/Release/buildRelease.sh +++ b/Tools/Release/buildRelease.sh @@ -1,8 +1,10 @@ #!/bin/sh +# Use sudo less Ruby export GEM_HOME=$HOME/.gem export PATH=$GEM_HOME/bin:$PATH + if [ ! $# -eq 1 ]; then echo "Usage: ./buildRelease.sh [tag or branch]" exit 1 @@ -31,6 +33,7 @@ gem install bundler bundle install bundle update + # Checkout the source to build mkdir -p $BUILD_DIR cd $BUILD_DIR