Skip to content

Commit

Permalink
Merge branch 'an/develop' into an/refactor/pokemon-detail-koin-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sh1mj1 committed Oct 23, 2024
2 parents 3ef8ff4 + 1aba612 commit 0f9a260
Show file tree
Hide file tree
Showing 11 changed files with 334 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,14 @@ defaults:
working-directory: ./android

jobs:
ktlintCheck:
name: ktLint Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Run ktLint Check
uses: ./.github/actions/ktlint_check
with:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}

testAlphaUnitTest:
name: Test Alpha Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Google-Services.json
env:
GOOGLE_SERVICES_ALPHA: ${{ secrets.GOOGLE_SERVICES_ALPHA }}
GOOGLE_SERVICES_BETA: ${{ secrets.GOOGLE_SERVICES_BETA }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/debug/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/alpha/google-services.json
echo $GOOGLE_SERVICES_BETA >> ./app/src/beta/google-services.json
echo $GOOGLE_SERVICES >> ./app/src/release/google-services.json
- name: Create Local Properties
run: touch local.properties

- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: run alpha unit test
run: ./gradlew testAlphaUnitTest
CI_Android_Develop:
uses: ./.github/workflows/Android_Develop_CI.yml
secrets: inherit

Distribution:
Distribution_To_Discord:
name: Alpha APK to Discord
runs-on: ubuntu-latest
needs: [ ktlintCheck, testAlphaUnitTest ]
needs: [ CI_Android_Develop ]
steps:
- uses: actions/checkout@v4
- name: Gradle cache
Expand Down Expand Up @@ -121,23 +62,8 @@ jobs:
- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
# POKE_RELEASE_URL: ${{ secrets.HOST_RELEASE_URI }}
# KEYSTORE_PATH: ${{ secrets.KEYSTORE_PATH }}
# STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
# KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
# KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
# STORE_FILE: ${{ secrets.STORE_FILE }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
# echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties
# echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties
# echo KEY_ALIAS= $KEY_ALIAS >> local.properties
# echo STORE_FILE= $STORE_FILE >> local.properties
# - name: Create Key Store
# env:
# KEY_STORE_BASE_64: ${{secrets.KEY_STORE_BASE_64}}
# run: |
# echo "$KEY_STORE_BASE_64" | base64 -d > ./funch_key_store.jks
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down Expand Up @@ -169,8 +95,8 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
CONTENT="최신 개발 버전 APK 가 나왔어요!🎉
[배포 버전] : $VERSION!
CONTENT="최신 개발 버전 APK 가 나왔어요!🎉
[배포 버전] : $VERSION!
[해당 PR 제목] : $PR_TITLE"
EMBED=$(jq -n \
--arg title "PR Merged: $PR_TITLE" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Android PR Builder
on:
pull_request:
branches: [ an/develop ]
workflow_call:

defaults:
run:
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/Android_Release_CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Android Release New Version 🎉

on:
push:
tags:
- "v*.*.*"

jobs:
CI_Android_Release:
uses: ./.github/workflows/Android_Release_CI.yml
secrets: inherit

Distribution_To_PlayStore:
name: CD Release Builder
runs-on: ubuntu-latest
needs: [ CI_Android_Release ]

steps:
- uses: actions/checkout@v4

- name: show github pull request
run: echo ${{ github.event.pull_request.title }}

- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Google-Services.json
env:
GOOGLE_SERVICES_ALPHA: ${{ secrets.GOOGLE_SERVICES_ALPHA }}
GOOGLE_SERVICES_BETA: ${{ secrets.GOOGLE_SERVICES_BETA }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/debug/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/alpha/google-services.json
echo $GOOGLE_SERVICES_BETA >> ./app/src/beta/google-services.json
echo $GOOGLE_SERVICES >> ./app/src/release/google-services.json
cat ./app/src/debug/google-services.json
working-directory: android

- name: Create Local Properties
run: touch local.properties
working-directory: android

- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
# POKE_DEV_BASE_URL: ${{ secrets.HOST_RELEASE_URI }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties
echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties
echo KEY_ALIAS= $KEY_ALIAS >> local.properties
working-directory: android

- name: Create RELEASE Key Store
env:
KEY_STORE: ${{secrets.RELEASE_KEY_STORE}}
run: |
touch ./keystore/poke_key.keystore
echo "$KEY_STORE" | base64 -d > ./keystore/poke_key.keystore
working-directory: android

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: android

- name: Build Release APK
run: ./gradlew assembleRelease
working-directory: android

- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: android/app/build/outputs/apk/release/
if-no-files-found: error

- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
android/app/build/outputs/apk/release/app-release.apk
- name: Build release aab
run: ./gradlew bundleRelease
working-directory: android

- name: Upload artifact to Google Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
packageName: poke.rogue.helper
93 changes: 93 additions & 0 deletions .github/workflows/Android_Release_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Android PR Builder

on:
push:
branches: [ "an/release*" ]
workflow_call:

jobs:
ktlintCheck:
name: ktLint Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Run ktLint Check
uses: ./.github/actions/ktlint_check
with:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}

testReleaseUnitTest:
name: CI Release Builder
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Google-Services.json
env:
GOOGLE_SERVICES_ALPHA: ${{ secrets.GOOGLE_SERVICES_ALPHA }}
GOOGLE_SERVICES_BETA: ${{ secrets.GOOGLE_SERVICES_BETA }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/debug/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/alpha/google-services.json
echo $GOOGLE_SERVICES_BETA >> ./app/src/beta/google-services.json
echo $GOOGLE_SERVICES >> ./app/src/release/google-services.json
cat ./app/src/debug/google-services.json
working-directory: android

- name: Create Local Properties
run: touch local.properties
working-directory: android

- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
# POKE_DEV_BASE_URL: ${{ secrets.HOST_RELEASE_URI }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties
echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties
echo KEY_ALIAS= $KEY_ALIAS >> local.properties
working-directory: android

- name: Create RELEASE Key Store
env:
KEY_STORE: ${{secrets.RELEASE_KEY_STORE}}
run: |
touch ./keystore/poke_key.jks
echo "$KEY_STORE" | base64 -d > ./keystore/poke_key.jks
working-directory: android

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: android

- name: Unit Test Release
run: ./gradlew testReleaseUnitTest
working-directory: android
Loading

0 comments on commit 0f9a260

Please sign in to comment.