Skip to content

Commit

Permalink
added the possibility to build .aab OR .apk
Browse files Browse the repository at this point in the history
  • Loading branch information
Primitivo committed Mar 18, 2020
1 parent e412d2a commit 3589e03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gitlab-ci-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ image: tmprimitivo/expo-turtle-build:stable
#please use gitlab ci env var for all this
build:
script:
- mkdir expo-apps/android/ #not required
- npm install
- expo login --username [EXPO_USERNAME] --password [EXPO_PASSWORD]
- expo publish
- expo fetch:android:keystore
- cp /usr/src/app/shExpoBuild/buildAndroid.sh ./buildAndroid.sh
- ./buildAndroid.sh [EXPO_ANDROID_KEYSTORE_PASSWORD] [EXPO_ANDROID_KEY_PASSWORD] [EXPO_USERNAME] [EXPO_PASSWORD] [pathToYourJKS] [keystoreAlias]
- ./buildAndroid.sh [EXPO_ANDROID_KEYSTORE_PASSWORD] [EXPO_ANDROID_KEY_PASSWORD] [EXPO_USERNAME] [EXPO_PASSWORD] [pathToYourJKS] [keystoreAlias] [TARGET]
12 changes: 10 additions & 2 deletions sources/buildAndroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ expoUsername=$3
expoPassword=$4
pathToYourJKS=$5
keystoreAlias=$6
target=$7

if [ "$target" == "apk" ]; then
extension="apk"
else
extension="aab"
fi

export EXPO_ANDROID_KEYSTORE_PASSWORD=$EXPO_ANDROID_KEYSTORE_PASSWORD
export EXPO_ANDROID_KEY_PASSWORD=$EXPO_ANDROID_KEY_PASSWORD
Expand All @@ -21,8 +28,9 @@ export EXPO_ANDROID_KEY_PASSWORD=$EXPO_ANDROID_KEY_PASSWORD

turtle setup:android

turtle build:android --username $expoUsername --password $expoPassword \
turtle build:android -t $target --username $expoUsername --password $expoPassword \
--keystore-path $pathToYourJKS --keystore-alias $keystoreAlias \
-o ~/expo-apps/android/$now/YOUR_APP_android_$timestamp.aab
-o ./expo-apps/android/$now/YOUR_APP_android_$timestamp.$extension

# If you don't use --public-url here^ I think it's better that you login to expo before
# starting the build (with expo login) and uncomment the "expo publish" line

0 comments on commit 3589e03

Please sign in to comment.