Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An/develop 에 release1.0.3 반영 #393

Merged
merged 20 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/Android_Develop_PR_CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,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
99 changes: 99 additions & 0 deletions .github/workflows/Android_Release_CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Android PR Builder

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

jobs:
build:
name: CD Release Builder
runs-on: ubuntu-latest

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.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: 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
84 changes: 84 additions & 0 deletions .github/workflows/Android_Release_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Android PR Builder

on:
push:
branches: [ "an/release*" ]
jobs:
build:
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: KT Lint
run: ./gradlew ktlintCheck
working-directory: android

- name: Unit Test Release
run: ./gradlew testReleaseUnitTest
working-directory: android
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ import poke.rogue.helper.presentation.home.HomeActivity
import poke.rogue.helper.presentation.util.context.startActivity
import poke.rogue.helper.presentation.util.repeatOnStarted

class PokemonIntroActivity() :
class PokemonIntroActivity :
ErrorHandleActivity<ActivityPokemonIntroBinding>(R.layout.activity_pokemon_intro) {
private val viewModel by viewModels<PokemonIntroViewModel> {
PokemonIntroViewModel.factory(DefaultDexRepository.instance(), analyticsLogger())
}
override val errorViewModel: ErrorHandleViewModel
get() = viewModel

override val toolbar: Toolbar? = null

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
repeatOnStarted {
viewModel.navigationToHomeEvent.collect {
finish()
finishAffinity()
startActivity<HomeActivity>()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import poke.rogue.helper.presentation.base.BaseViewModelFactory
import poke.rogue.helper.presentation.base.error.ErrorHandleViewModel
import poke.rogue.helper.presentation.util.event.MutableEventFlow
import poke.rogue.helper.presentation.util.event.asEventFlow
import timber.log.Timber

class PokemonIntroViewModel(
private val pokemonRepository: DexRepository,
Expand All @@ -36,7 +35,7 @@ class PokemonIntroViewModel(
launch { getKoin().get<DexRepository>().warmUp() }
}
} catch (e: Exception) {
Timber.e(e)
handlePokemonError(e)
} finally {
_navigationToHomeEvent.emit(Unit)
}
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ koin = "4.0.0"
minSdk = "26"
robolectric = "4.13"
targetSdk = "34"
appVersion = "1.0.1"
versionCode = "10001"
appVersion = "1.0.3"
versionCode = "10003"
agp = "8.3.2"

# kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,13 @@ abstract class PokeRogueDatabase : RoomDatabase() {
.build().also { instance = it }
}
}

fun dropDatabase(context: Context) {
synchronized(this) {
instance?.close()
instance = null
context.deleteDatabase(DATABASE_NAME)
}
}
}
}
Loading