Skip to content

Commit

Permalink
Merge pull request #23 from brandy-kay/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyodhiambo committed Sep 11, 2023
2 parents b46ce08 + 84af709 commit d43517d
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Android Build

on:
push:
branches: [ develop ]
branches: [ main ]
pull_request:
branches: [ develop ]
branches: [ main ]

jobs:
build:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy App CI

on:
pull_request:
branches: [ main ]
types: [ closed ]

jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant rights
run: chmod +x build.gradle

- name: Build with Gradle
id: build
run: ./gradlew build --stacktrace

- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleRelease --stacktrace

- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json

- name: Deploy to Play Store
id: deploy
uses: r0adkll/[email protected]
with:
serviceAccountJson: service_account.json
packageName: com.brandyodhiambo.quench
releaseFile: app/build/outputs/bundle/release/app-release.aab
track: internal



10 changes: 5 additions & 5 deletions app/src/main/java/com/brandyodhiambo/quench/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MainActivity : ComponentActivity() {
QuenchTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background,
color = MaterialTheme.colors.background
) {
startAchievementOnetimeWorkRequest(applicationContext)
startDailyOnetimeWorkRequest(applicationContext)
Expand All @@ -75,7 +75,7 @@ class MainActivity : ComponentActivity() {
val scheduler = AlarmSchedularImpl(this)
val alarmItem = AlarmData(
time = LocalDateTime.now().withHour(hours).withMinute(minutes),
message = getString(R.string.it_s_time_to_drink_water),
message = getString(R.string.it_s_time_to_drink_water)
)
alarmItem.let(scheduler::schedule)
val navController = rememberAnimatedNavController()
Expand All @@ -87,9 +87,9 @@ class MainActivity : ComponentActivity() {
engine = navHostEngine,
dependenciesContainerBuilder = {
dependency(
currentNavigator(),
currentNavigator()
)
},
}
)
}
}
Expand All @@ -100,7 +100,7 @@ class MainActivity : ComponentActivity() {
fun DestinationScope<*>.currentNavigator(): FeatureNavigator {
return FeatureNavigator(
navController = navController,
navGraph = navBackStackEntry.destination.navGraph(),
navGraph = navBackStackEntry.destination.navGraph()
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C)2023 Brandy Odhiambo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.brandyodhiambo.home.presentation.achievement

import androidx.lifecycle.ViewModel
Expand Down
Loading

0 comments on commit d43517d

Please sign in to comment.