From b8f9e8cccf5b2ff96d08cddb1f31243857d940ea Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 8 Feb 2017 23:35:16 +0900 Subject: [PATCH 01/12] Modify gitignore --- .gitignore | 1 + .idea/codeStyleSettings.xml | 387 ------------------------------------ .idea/gradle.xml | 19 -- .idea/icon.png | 1 - .idea/misc.xml | 87 -------- .idea/modules.xml | 10 - 6 files changed, 1 insertion(+), 504 deletions(-) delete mode 100644 .idea/codeStyleSettings.xml delete mode 100644 .idea/gradle.xml delete mode 120000 .idea/icon.png delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml diff --git a/.gitignore b/.gitignore index 4cf15812..699dcee4 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ captures/ *.iml .idea/* !.idea/codeStyleSettings.xml +.idea/ # Keystore files *.jks diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index a2949dc4..00000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 760ea464..00000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/icon.png b/.idea/icon.png deleted file mode 120000 index 49bb01fe..00000000 --- a/.idea/icon.png +++ /dev/null @@ -1 +0,0 @@ -../app/src/main/res/mipmap-xhdpi/ic_launcher.png \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 0777fea3..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.8 - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index b8cc6e85..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 657be4630dc8940ff98511d3c9370abd64dd35c9 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 8 Feb 2017 23:45:14 +0900 Subject: [PATCH 02/12] Write deploy shell to GooglePlay --- deploy2store.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 deploy2store.sh diff --git a/deploy2store.sh b/deploy2store.sh new file mode 100644 index 00000000..9430a3b7 --- /dev/null +++ b/deploy2store.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +fastlane supply run -p io.github.droidkaigi.confsched2017 \ +-a alpha \ +-j [RELEASE_JSON_KEY_FILE_PATH]] \ +-u [APK_FILE_PATH] \ +--verbose --skip_upload_images --skip_upload_screenshots \ No newline at end of file From 67b7ba9d9dac23f907b71f6f0a0b37d83bdd8889 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Thu, 9 Feb 2017 00:25:32 +0900 Subject: [PATCH 03/12] Introduce Firebase crash report plugin --- app/build.gradle | 1 + build.gradle | 1 + 2 files changed, 2 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 44e27efc..a22f202c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,6 +5,7 @@ apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'me.tatarka.retrolambda' apply plugin: 'kotlin-android' +apply plugin: 'com.google.firebase.firebase-crash' // Manifest version def versionMajor = 0 diff --git a/build.gradle b/build.gradle index fadc8d58..a6572917 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ buildscript { classpath 'me.tatarka:gradle-retrolambda:3.4.0' classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.6" + classpath 'com.google.firebase:firebase-plugins:1.0.5' } configurations.classpath.exclude group: 'com.android.tools.external.lombok' From 2faa168fbd56d08581b03ad468d519ec3baf2bef Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Tue, 14 Feb 2017 23:14:06 +0900 Subject: [PATCH 04/12] Add deploy to store shell --- .gitignore | 3 ++- app/build.gradle | 1 + deploy2store.sh | 4 ++-- gradle/task.gradle | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) mode change 100644 => 100755 deploy2store.sh create mode 100644 gradle/task.gradle diff --git a/.gitignore b/.gitignore index cfc3fb44..c9a8fbc8 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ captures/ # Keystore files *.jks -.DS_Store \ No newline at end of file +.DS_Store +/key.json diff --git a/app/build.gradle b/app/build.gradle index 071a18c9..c1617d1e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,6 +7,7 @@ apply plugin: 'kotlin-android' apply plugin: 'com.google.firebase.firebase-crash' apply plugin: 'com.cookpad.android.licensetools' apply plugin: 'com.github.ben-manes.versions' +apply from: '../gradle/task.gradle' // Manifest version def versionMajor = 0 diff --git a/deploy2store.sh b/deploy2store.sh old mode 100644 new mode 100755 index 9430a3b7..5655e5ca --- a/deploy2store.sh +++ b/deploy2store.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash fastlane supply run -p io.github.droidkaigi.confsched2017 \ -a alpha \ --j [RELEASE_JSON_KEY_FILE_PATH]] \ --u [APK_FILE_PATH] \ +-j ./key.json \ +-u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ --verbose --skip_upload_images --skip_upload_screenshots \ No newline at end of file diff --git a/gradle/task.gradle b/gradle/task.gradle new file mode 100644 index 00000000..1e3ab232 --- /dev/null +++ b/gradle/task.gradle @@ -0,0 +1,7 @@ +task releaseApp(type: Exec) { + workingDir '../' + commandLine "./gradlew", "clean " + commandLine "chmod", "777", "deploy2store.sh" + commandLine "./deploy2store.sh" +} + From f799f0107ee04525373767e8f72793e1d0ee302a Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Tue, 14 Feb 2017 23:49:52 +0900 Subject: [PATCH 05/12] clean up task.gradle --- .idea/codeStyleSettings.xml | 387 ++++++++++++++++++++++++++++++++++++ gradle/task.gradle | 2 - 2 files changed, 387 insertions(+), 2 deletions(-) create mode 100644 .idea/codeStyleSettings.xml diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 00000000..a2949dc4 --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,387 @@ + + + + + + \ No newline at end of file diff --git a/gradle/task.gradle b/gradle/task.gradle index 1e3ab232..a1096612 100644 --- a/gradle/task.gradle +++ b/gradle/task.gradle @@ -1,7 +1,5 @@ task releaseApp(type: Exec) { workingDir '../' commandLine "./gradlew", "clean " - commandLine "chmod", "777", "deploy2store.sh" commandLine "./deploy2store.sh" } - From 08025db4f1e608f09a436c2529dc8f6b4819ba3d Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 15 Feb 2017 00:40:43 +0900 Subject: [PATCH 06/12] Add Automated release readme --- README_AUTOMATED_RELEASE.md | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 README_AUTOMATED_RELEASE.md diff --git a/README_AUTOMATED_RELEASE.md b/README_AUTOMATED_RELEASE.md new file mode 100644 index 00000000..f8742540 --- /dev/null +++ b/README_AUTOMATED_RELEASE.md @@ -0,0 +1,67 @@ +# Automated release + +Make releasing easy! + +If you have any question, feel free to ask to me (@wakwa3125). + +# ATTENTION + +**FIRST YOU MUST UPLOAD YOUR APK FILE WITH NON-AUTOMATED FLOW** +**THIS IS PUBLISHING API RESTRICT** + +# Setup + +## 1. Create Service Account at GooglePlayConsole. + +1. Go to your Google Play Developer Console. +2. Select Settings tab. +3. Select API access tab. +4. Click Create ServiceAccount and follow the dialog. +5. Provide name for the ServiceAccount. +6. Click Select a role and choose Project > **Service Account Actor** +7. **Furnish a new private key checkbox**(It's important!) +8. Select JSON as the key type. +9. Click create. +10. Download the JSON key file as file name **key.json** +11. Back to Google Play Developer Console, and click Done button. +12. Provide access to the new ServiceAccount. +13. Set Release Manager as role of new ServiceAccount. +14. Click add user to close the dialog. + +## 2. Prepare for this project. + +1. First run `./gradlew setUpRelease` +This just create required files. + +2. Put your key.json file to project root. +This file has add to .gitignore. So it's safe. + +3. Open `deploy2store.sh` and replace `[YOUR_APK_FILE_NAME]` to yours. + +4. Second run `./gradlew donwloadMetaData` +This download all metadata(such as changelogs) from GooglePlayStore and save them to repo. + +# Release +## Write changelogs +- **You can skip this. Because you can wirte changelog at your console.** +**File name roule is [versioncode].txt** +Save your changelogs like a following directory. +This directory is made by run `./gradlew downloadMetaData` + +``` +└── fastlane + └── metadata + └── android + ├── en-US + │ └── changelogs + │ ├── 100000.txt + │ └── 100100.txt + └── fr-FR + └── changelogs + └── 100100.txt + ... +``` + +## Run the script +- Just run `./gradlew releaseApp` +APK will upload to alpha channel. \ No newline at end of file From cb47de117463826ead97f786c3470bec3f48824b Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 15 Feb 2017 01:19:54 +0900 Subject: [PATCH 07/12] Create shells for initialization --- .gitignore | 1 + README_AUTOMATED_RELEASE.md | 10 ++++++++-- bootstrap.sh | 1 + deploy2store.template | 6 ++++++ gradle/task.gradle | 25 ++++++++++++++++++++++++- initsupply.sh | 3 +++ 6 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 bootstrap.sh create mode 100755 deploy2store.template create mode 100644 initsupply.sh diff --git a/.gitignore b/.gitignore index c9a8fbc8..b6266f26 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ captures/ .DS_Store /key.json +/deploy2store.sh diff --git a/README_AUTOMATED_RELEASE.md b/README_AUTOMATED_RELEASE.md index f8742540..0bf1fc0d 100644 --- a/README_AUTOMATED_RELEASE.md +++ b/README_AUTOMATED_RELEASE.md @@ -11,7 +11,13 @@ If you have any question, feel free to ask to me (@wakwa3125). # Setup -## 1. Create Service Account at GooglePlayConsole. +## 1. Install supply(fastlane) + +``` +gem install fastlane +``` + +## 2. Create Service Account at GooglePlayConsole. 1. Go to your Google Play Developer Console. 2. Select Settings tab. @@ -28,7 +34,7 @@ If you have any question, feel free to ask to me (@wakwa3125). 13. Set Release Manager as role of new ServiceAccount. 14. Click add user to close the dialog. -## 2. Prepare for this project. +## 3. Prepare for this project. 1. First run `./gradlew setUpRelease` This just create required files. diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 00000000..98ef60fb --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1 @@ +cp deploy2store.template deploy2store.sh diff --git a/deploy2store.template b/deploy2store.template new file mode 100755 index 00000000..5655e5ca --- /dev/null +++ b/deploy2store.template @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +fastlane supply run -p io.github.droidkaigi.confsched2017 \ +-a alpha \ +-j ./key.json \ +-u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ +--verbose --skip_upload_images --skip_upload_screenshots \ No newline at end of file diff --git a/gradle/task.gradle b/gradle/task.gradle index a1096612..cd3032ce 100644 --- a/gradle/task.gradle +++ b/gradle/task.gradle @@ -1,5 +1,28 @@ +/** + * Copy template shell + * */ +task setUpRelease(type: Exec) { + workingDir '../' + commandLine "./gradlew", "clean" + commandLine "./bootstrap.sh" +} + +/** + * + * Init this project with supply + * */ +task downloadMetaData(type: Exec) { + workingDir '../' + commandLine "./gradlew", "clean" + commandLine "./initsupply.sh" +} + +/** + * + * Release your AWESOME app to GooglePlay(alpha channel) + * */ task releaseApp(type: Exec) { workingDir '../' - commandLine "./gradlew", "clean " + commandLine "./gradlew", "clean" commandLine "./deploy2store.sh" } diff --git a/initsupply.sh b/initsupply.sh new file mode 100644 index 00000000..5a4f4a81 --- /dev/null +++ b/initsupply.sh @@ -0,0 +1,3 @@ +fastlane supply init \ +-j key.json \ +-p o.github.droidkaigi.confsched2017 \ No newline at end of file From 8d5636c22b4bc00219273e3244f1cccb39a3e8d0 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 15 Feb 2017 01:22:59 +0900 Subject: [PATCH 08/12] Add line break at end of file --- deploy2store.sh | 2 +- deploy2store.template | 2 +- initsupply.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy2store.sh b/deploy2store.sh index 5655e5ca..ba4ca1df 100755 --- a/deploy2store.sh +++ b/deploy2store.sh @@ -3,4 +3,4 @@ fastlane supply run -p io.github.droidkaigi.confsched2017 \ -a alpha \ -j ./key.json \ -u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ ---verbose --skip_upload_images --skip_upload_screenshots \ No newline at end of file +--verbose --skip_upload_images --skip_upload_screenshots diff --git a/deploy2store.template b/deploy2store.template index 5655e5ca..ba4ca1df 100755 --- a/deploy2store.template +++ b/deploy2store.template @@ -3,4 +3,4 @@ fastlane supply run -p io.github.droidkaigi.confsched2017 \ -a alpha \ -j ./key.json \ -u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ ---verbose --skip_upload_images --skip_upload_screenshots \ No newline at end of file +--verbose --skip_upload_images --skip_upload_screenshots diff --git a/initsupply.sh b/initsupply.sh index 5a4f4a81..4f3c8684 100644 --- a/initsupply.sh +++ b/initsupply.sh @@ -1,3 +1,3 @@ fastlane supply init \ -j key.json \ --p o.github.droidkaigi.confsched2017 \ No newline at end of file +-p o.github.droidkaigi.confsched2017 From 6f190af8448a853670d14ce6e4a8155354770eab Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Wed, 15 Feb 2017 01:23:27 +0900 Subject: [PATCH 09/12] Untrack deploy shell --- deploy2store.sh | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 deploy2store.sh diff --git a/deploy2store.sh b/deploy2store.sh deleted file mode 100755 index ba4ca1df..00000000 --- a/deploy2store.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -fastlane supply run -p io.github.droidkaigi.confsched2017 \ --a alpha \ --j ./key.json \ --u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ ---verbose --skip_upload_images --skip_upload_screenshots From e51810c326722084c7f8bbfc198fa213dbc67548 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Thu, 16 Feb 2017 01:37:19 +0900 Subject: [PATCH 10/12] Move automation scripts to script directory --- bootstrap.sh | 1 - gradle/task.gradle | 7 ++++--- script/bootstrap.sh | 1 + deploy2store.template => script/deploy2store.sh | 0 script/deploy2store.template | 6 ++++++ initsupply.sh => script/initsupply.sh | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) delete mode 100755 bootstrap.sh create mode 100755 script/bootstrap.sh rename deploy2store.template => script/deploy2store.sh (100%) create mode 100755 script/deploy2store.template rename initsupply.sh => script/initsupply.sh (78%) diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 98ef60fb..00000000 --- a/bootstrap.sh +++ /dev/null @@ -1 +0,0 @@ -cp deploy2store.template deploy2store.sh diff --git a/gradle/task.gradle b/gradle/task.gradle index cd3032ce..e30fd929 100644 --- a/gradle/task.gradle +++ b/gradle/task.gradle @@ -4,7 +4,7 @@ task setUpRelease(type: Exec) { workingDir '../' commandLine "./gradlew", "clean" - commandLine "./bootstrap.sh" + commandLine "./script/bootstrap.sh" } /** @@ -14,15 +14,16 @@ task setUpRelease(type: Exec) { task downloadMetaData(type: Exec) { workingDir '../' commandLine "./gradlew", "clean" - commandLine "./initsupply.sh" + commandLine "./script/initsupply.sh" } /** * * Release your AWESOME app to GooglePlay(alpha channel) * */ + // TODO: Build apk with FirebaseCrash plugin task releaseApp(type: Exec) { workingDir '../' commandLine "./gradlew", "clean" - commandLine "./deploy2store.sh" + commandLine "./script/deploy2store.sh" } diff --git a/script/bootstrap.sh b/script/bootstrap.sh new file mode 100755 index 00000000..db2417a4 --- /dev/null +++ b/script/bootstrap.sh @@ -0,0 +1 @@ +cp ./script/deploy2store.template ./script/deploy2store.sh diff --git a/deploy2store.template b/script/deploy2store.sh similarity index 100% rename from deploy2store.template rename to script/deploy2store.sh diff --git a/script/deploy2store.template b/script/deploy2store.template new file mode 100755 index 00000000..ba4ca1df --- /dev/null +++ b/script/deploy2store.template @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +fastlane supply run -p io.github.droidkaigi.confsched2017 \ +-a alpha \ +-j ./key.json \ +-u /app/build/outputs/apk/[YOUR_APK_FILE_NAME] \ +--verbose --skip_upload_images --skip_upload_screenshots diff --git a/initsupply.sh b/script/initsupply.sh similarity index 78% rename from initsupply.sh rename to script/initsupply.sh index 4f3c8684..5bafbadf 100644 --- a/initsupply.sh +++ b/script/initsupply.sh @@ -1,3 +1,3 @@ fastlane supply init \ --j key.json \ +-j ./key.json \ -p o.github.droidkaigi.confsched2017 From df2b8c85a3f749b8c05bfb6d4ee911226f148cd3 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Thu, 16 Feb 2017 01:49:09 +0900 Subject: [PATCH 11/12] Add FirebaseCrashRepot task --- gradle.properties | 3 +++ gradle/task.gradle | 1 + 2 files changed, 4 insertions(+) diff --git a/gradle.properties b/gradle.properties index 3c9acb2e..30337019 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,3 +10,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro org.gradle.parallel=true org.gradle.daemon=true org.gradle.configureondemand=true + +# Firebase Crash Plugin +FirebaseServiceAccountFilePath=[SET_YOUR_PATH_TO_FIREBASE_SERVICE_ACCOUNT_FILE] diff --git a/gradle/task.gradle b/gradle/task.gradle index e30fd929..7bf96e46 100644 --- a/gradle/task.gradle +++ b/gradle/task.gradle @@ -25,5 +25,6 @@ task downloadMetaData(type: Exec) { task releaseApp(type: Exec) { workingDir '../' commandLine "./gradlew", "clean" + commandLine "./gradlew", "app:firebaseUploadProductionReleaseProguardMapping" commandLine "./script/deploy2store.sh" } From 95d9dc3cd45f37fa73c459b2c23d6fdca34cbe30 Mon Sep 17 00:00:00 2001 From: Ryo Sakaguchi Date: Thu, 16 Feb 2017 01:56:24 +0900 Subject: [PATCH 12/12] Fix filename --- .gitignore | 1 + gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b6266f26..478b4feb 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ captures/ .DS_Store /key.json /deploy2store.sh +/serviceaccount.json \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 30337019..a6c26a43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,4 @@ org.gradle.daemon=true org.gradle.configureondemand=true # Firebase Crash Plugin -FirebaseServiceAccountFilePath=[SET_YOUR_PATH_TO_FIREBASE_SERVICE_ACCOUNT_FILE] +FirebaseServiceAccountFilePath=serviceaccount.json