diff --git a/.editorconfig b/.editorconfig index beb7979..2eaa706 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,14 @@ [*] -charset=utf-8 -end_of_line=lf -trim_trailing_whitespace=true -insert_final_newline=true -indent_style=space -indent_size=4 -max_line_length=120 +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 +max_line_length = off + +[{*.yml, *.yaml, *.json}] +indent_size = 2 +disabled_rules = no-wildcard-imports, experimental:annotation, my-custom-ruleset -[{*.yml,*.yaml,*.json}] -indent_size=2 diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..2b55cbd --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,71 @@ +name: Android CI + +on: + push: + branches: [ github_ci_build ] + pull_request: + branches: [ github_ci_build ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + # - name: Setup ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: 2.7 + - name: current dir + run: pwd + - name: Grant execute permission for decrypt_secret.sh + run: chmod +x ffc/decrypt_secret.sh + - name: Descrypt google-service + run: ./ffc/decrypt_secret.sh + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_KEY_DESCRYPT }} + - name: Grant execute permission for gradlew + run: chmod +x gradlew + #- name: update sdk + # run: echo y | android update sdk --no-ui --filter platform-tool + - name: update sdk + run: yes | sdkmanager --update + #- name: Install ndk + # run: yes | sdkmanager --install "ndk;21.3.6528147" --channel=3 + #- name: Install Cmark + # run: yes | sdkmanager --install "cmake" + - name: android verstion build + run: yes | sdkmanager "platforms;android-30" + - name: ffc:androidDependencies + run: ./gradlew ffc:androidDependencies + - name: ffc:getDependencies + run: ./gradlew ffc:getDependencies + - name: Build GitVersion + run: ./gradlew ffc:androidGitVersion + - name: Build with Gradle + run: ./gradlew build + env: + RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} + RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} + - name: List file in build + run: ls -al ffc/build/ + - name: List file in build/* + run: ls -al ffc/build/* + - name: List file in build/*/* + run: ls -al ffc/build/*/* + - name: find ffc/build + run: find ffc/build +# - name: Archive apk +# uses: actions/upload-artifact@v2 +# with: +# name: store apk +# path: ffc/build/outputs/apk/release/ffc-release.apk diff --git a/ffc/build.gradle b/ffc/build.gradle index a869ca8..dcb4e20 100644 --- a/ffc/build.gradle +++ b/ffc/build.gradle @@ -15,7 +15,7 @@ * limitations under the License. */ plugins { - id 'com.gladed.androidgitversion' version '0.4.5' + id 'com.gladed.androidgitversion' version '0.4.14' } @@ -30,6 +30,7 @@ apply plugin: 'io.fabric' android { compileSdkVersion 30 +// ndkVersion "23.1.7779620" // buildToolsVersion "30.0.2" // compileOptions { // sourceCompatibility JavaVersion.VERSION_1_8 @@ -45,8 +46,10 @@ android { applicationId "ffc.app" minSdkVersion 26 targetSdkVersion 30 - versionCode androidGitVersion.code() + versionCode androidGitVersion.code() == 0?1:androidGitVersion.code() versionName androidGitVersion.name() + //versionCode 4 + //versionName "test_ffc" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } @@ -178,7 +181,7 @@ dependencies { implementation 'de.hdodenhof:circleimageview:2.2.0' implementation 'joda-time:joda-time:2.10.1' implementation 'me.piruin:spinney:1.0.0' - implementation 'me.piruin:phototaker:1.2' + //implementation 'me.piruin:phototaker:1.2' implementation "org.jetbrains.anko:anko-appcompat-v7-commons:$ankoVersion" implementation "org.jetbrains.anko:anko-design:$ankoVersion" diff --git a/ffc/decrypt_secret.sh b/ffc/decrypt_secret.sh new file mode 100644 index 0000000..af1a5fd --- /dev/null +++ b/ffc/decrypt_secret.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# max NOTE +# Ref: https://docs.github.com/en/actions/security-guides/encrypted-secrets +# enscrypt command = gpg --symmetric --cipher-algo AES256 my_secret.json +# Decrypt the file +# mkdir $HOME/secrets +# --batch to prevent interactive command +# --yes to assume "yes" for questions +pwd +echo "_____Decrypt_______" +gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" \ +--output ffc/google-services.json ffc/google-services.json.gpg diff --git a/ffc/google-services.json.gpg b/ffc/google-services.json.gpg new file mode 100644 index 0000000..2483f0e Binary files /dev/null and b/ffc/google-services.json.gpg differ diff --git a/ffc/release.keystore b/ffc/release.keystore index 22969ff..38c1999 100644 Binary files a/ffc/release.keystore and b/ffc/release.keystore differ