Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Integrate fastlane and finish deployment process (#97)
Browse files Browse the repository at this point in the history
* Rename configuration gradle files

* Initialize fastlane

* Ignore fastlane/metadata

* Update app icon

* Finish fastlane integration

* Update README.md
  • Loading branch information
george-lim authored Aug 18, 2020
1 parent 29c90d9 commit a47261f
Show file tree
Hide file tree
Showing 25 changed files with 318 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ lint/reports/
.project
.settings/
team/
fastlane/metadata
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
178 changes: 178 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.356.0)
aws-sdk-core (3.104.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.36.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.78.0)
aws-sdk-core (~> 3, >= 3.104.3)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.6.1)
rake (~> 13.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.0.0)
excon (0.76.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.0)
fastlane (2.156.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.3)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.27.0)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.13.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.3.1)
jwt (2.2.1)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.0)
os (1.1.1)
plist (3.5.0)
public_suffix (4.0.5)
rake (13.0.1)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.18.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
ruby

DEPENDENCIES
fastlane

BUNDLED WITH
2.1.2
64 changes: 5 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,15 @@
<!-- [START getstarted] -->
## Getting Started

All configuration files are stored in the `$projectDir/team` folder which is ignored by git.
Contact [@george-lim](http://github.com/george-lim) for access to the team's existing configuration files. Alternatively, you may wish to create new configuration files for this project.
### Wiki

### Creating new configuration files
**NOTE: If you already have the configuration files, you may skip to the [installation](#installation) step**
Please refer to the [wiki](https://github.com/george-lim/bruno-android/wiki) before asking for help 🙏 [Coding and PR guidelines](https://github.com/george-lim/bruno-android/wiki/Coding-and-PR-guide) as well as the [deployment process](https://github.com/george-lim/bruno-android/wiki/Deployment-process) are documented there. In the future, complex team components and decisions will also be documented in the wiki.

1. Create a `team` folder in the project root directory and `cd` into it
2. Create `debug.keystore` by executing:
```bash
store_name='debug.keystore'
store_password='android'
key_alias='androiddebugkey'
key_password=$store_password
### Configuration

keytool -genkey -v -keystore $store_name -storepass $store_password -alias $key_alias -keypass $key_password -keyalg RSA -keysize 2048 -validity 100000 -dname "C=US, O=Android, CN=Android Debug"
```
3. Create `release.keystore` by executing:
```bash
store_name='release.keystore'
store_password='********'
key_alias='androidreleasekey'
key_password=$store_password
Contact [@george-lim](http://github.com/george-lim) for access to the team's configuration files. Just copy the files to the `$projectDir/team` folder, and you are ready to go. The `team` folder is ignored by git.

keytool -genkey -v -keystore $store_name -storepass $store_password -alias $key_alias -keypass $key_password -keyalg RSA -keysize 2048 -validity 100000
```
4. Using variable values from step 2, create `debugConfig.gradle` using the following template:
```gradle
ext.debugConfig = [
// Signing configuration keys
store_file: '../team/{store_name}',
store_password: {store_password},
key_alias: {key_alias},
key_password: {key_password},
// Third-party secret keys
google_api_key: '',
spotify_client_id: '',
spotify_client_secret: '',
spotify_redirect_uri: ''
]
```
5. Using variable values from step 3, create `releaseConfig.gradle` using the template from step 4

The following guides show how to create and add third-party secret keys to `debugConfig.gradle`. You may want to consider repeating certain steps to have different secret keys for `releaseConfig.gradle`.

**Google Setup**
1. Create a new project on [Google Cloud](https://console.developers.google.com/projectcreate)
2. Enable [Maps SDK for Android](https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID)
3. Enable [Directions API](https://console.developers.google.com/apis/library/directions-backend.googleapis.com?q=Directions)
4. Create and [link a billing account](https://console.developers.google.com/billing/linkedaccount)
5. Create an [API key](https://console.developers.google.com/apis/credentials?authuser=1&project=bruno-286305&supportedpurview=project)
6. Restrict the API key to the two enabled APIs
7. Add the key to `google_api_key` in `debugConfig.gradle`

**Spotify Setup**
1. Create a new application from the [Spotify developer dashboard](https://developer.spotify.com/dashboard/applications)
2. Find the client ID and add it to `spotify_client_id` in `debugConfig.gradle`
3. Find the client secret and add it to `spotify_client_secret` in `debugConfig.gradle`
4. From the dashboard, add the package name `com.bruno.android.dev` and the `debug.keystore` SHA1 fingerprint through the `edit settings` menu. Repeat this step for the package name `com.bruno.android` and the `release.keystore` SHA1 fingerprint. You can get the SHA1 fingerprint of a Keystore by executing:
```
keytool -list -v -keystore {store_name} -storepass {store_password} -alias {key_alias} -keypass {key_password}
```
5. From the dashboard, create a redirect URI through the `edit settings` menu
6. Add the URI to `spotify_redirect_uri` in `debugConfig.gradle`
You may also [create a new project configuration](https://github.com/george-lim/bruno-android/wiki/Creating-a-new-project-configuration).

### Installation

Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

if (file('../team/debugConfig.gradle').exists()) {
apply from: '../team/debugConfig.gradle'
if (file('../team/debug-config.gradle').exists()) {
apply from: '../team/debug-config.gradle'
}

if (file('../team/releaseConfig.gradle').exists()) {
apply from: '../team/releaseConfig.gradle'
if (file('../team/release-config.gradle').exists()) {
apply from: '../team/release-config.gradle'
}

boolean hasDebugConfig = project.hasProperty('debugConfig')
Expand Down Expand Up @@ -38,7 +38,7 @@ android {
applicationId "com.bruno.android"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionCode 2
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Binary file removed app/src/main/ic_launcher-playstore.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 3 additions & 3 deletions app/src/main/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#F4A69B</color>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
2 changes: 2 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json_key_file("team/service-account-key.json")
package_name("com.bruno.android")
Loading

0 comments on commit a47261f

Please sign in to comment.