Skip to content

Commit

Permalink
Add CI files for testing release functionality
Browse files Browse the repository at this point in the history
Somebody messed Firebase signatures
Had to update them
Also implemented signing apk built from cloud since
firebase needs a fixed SHA-1 from apk
  • Loading branch information
virresh committed Oct 30, 2019
1 parent 7880cd1 commit b093328
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 11 deletions.
24 changes: 24 additions & 0 deletions .ci/set_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BRANCH="apk_deploy"

# Are we on the right branch?
if [ "$TRAVIS_BRANCH" = "$BRANCH" ]; then

# Is this not a Pull Request?
if [ "$TRAVIS_PULL_REQUEST" = false ]; then

# Is this not a build which was triggered by setting a new tag?
if [ -z "$TRAVIS_TAG" ]; then
echo -e "Starting to tag commit.\n"

git config --global user.email "[email protected]"
git config --global user.name "Travis"

# Add tag and push to master.
git tag -a v${TRAVIS_BUILD_NUMBER} -m "Travis build $TRAVIS_BUILD_NUMBER pushed a tag."
git push origin --tags
git fetch origin

echo -e "Done magic with tags.\n"
fi
fi
fi
30 changes: 19 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ language: android
dist: trusty
android:
components:
# The BuildTools version used by your project
- build-tools-29.0.1

# The SDK version used to compile your project
- android-29

before_script:
- chmod +x gradlew
- openssl aes-256-cbc -K $encrypted_2844885ced97_key -iv $encrypted_2844885ced97_iv -in app/ci_secret.txt -out app/google-services.json -d

- build-tools-29.0.1
- android-29
before_script:
- chmod +x gradlew
- openssl aes-256-cbc -K $encrypted_2844885ced97_key -iv $encrypted_2844885ced97_iv -in cloud.tar.gz.enc -out cloud.tar.gz -d
- tar -xvf cloud.tar.gz
- ls -la
script:
- ./gradlew build
- "./gradlew clean build assembleRelease"
deploy:
skip_cleanup: true
provider: releases
api_key:
secure: ngLvYtd5/lQqLjm65B3vkBBwMKdbQEbkReBeKbJOwNogOOMcrFTBnKHOCud0otk0JMYZPYNI5Dcp8MaPcyqwrmmVTQRSCphx/xZbOYH9ivNisSJhAW7b/OO6bYFcFY1XyP3yrhJ4fAqHJA0JdCTlG7qY/BqkYKuBWG4xEdbkxfiD/MbD2nCP5yU2NQ2fejPcEBaK4rSRprF1WauugPfjaIxGoU8hmsbr+gGCBWbJ5Pi7cQEwRvaB4lz8afuBJ++J/fLB88HTs3dh0h31Pg7uSeBe+nJuZmwd0AviY4kQrjGN/LOV91cYajxEn+99Bx2gWwddY6yheT/hpjC8Ha1cTjWj7QytAnG1CAQdmNFAEk5qDR2TT+uxxdWjFBnODOBda39xTbsY71WFx24MHmicelaEozT4RvZb38JvwASv19uW3ZHnnqbLo+ocWD57KWPsucoKEuMQSpXoMDy6rLcDrgXz4HGA6JlpnKiJ505uSTZUdt8nCHRvgM1UnqaK7ENv9xGxKClCoRmJT4YkHZ+7g8du7TFSt21/HSwLtSRCRuFqjkOTxQSbYPmTmncn1ZMJto0u1D5ppQcffVvRVmwOO/3UyR9YWZ9v+IwR3VYTOdxvAFMeqDQpdHhQKtIQEPc4kpQI2TTF47ERvAzSvGBOlZuxx5oIUXsu44LuizKz8Co=
file: app/build/outputs/apk/release/app-release.apk
on:
branch: apk_deploy
repo: virresh/Sahaayak
after_success:
- sh set_tags.sh
14 changes: 14 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

def isRunningOnTravis = System.getenv("CI") == "true"

if (isRunningOnTravis) {
// configure keystore
signingConfigs.release.storeFile = file(System.getenv("RELEASE_STORE_FILE"))
signingConfigs.release.storePassword = System.getenv("RELEASE_STORE_PASSWORD")
signingConfigs.release.keyAlias = System.getenv("RELEASE_KEY_ALIAS")
signingConfigs.release.keyPassword = System.getenv("RELEASE_KEY_PASSWORD")
}
}

apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
Expand Down
Binary file removed app/ci_secret.txt
Binary file not shown.
Binary file added cloud.tar.gz.enc
Binary file not shown.

0 comments on commit b093328

Please sign in to comment.