Skip to content

Commit

Permalink
Merge pull request #23 from ImaginativeShohag/dev
Browse files Browse the repository at this point in the history
Fix GH action issues
  • Loading branch information
ImaginativeShohag authored Jun 30, 2023
2 parents 068058b + 921867c commit a61fe5f
Show file tree
Hide file tree
Showing 36 changed files with 1,148 additions and 868 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-beta-upload-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Android Build & Deploy (Beta)

on:
pull_request:
types:
- closed
branches: [ "dev" ]

jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
bundler-cache: true

- name: Initialize local properties
env:
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
CMS_API_KEY: ${{ secrets.CMS_API_KEY }}
run: echo MAPS_API_KEY="$MAPS_API_KEY" >> ./local.properties ; echo CMS_API_KEY="$CMS_API_KEY" >> ./local.properties

# Set up your GitHub Actions workflow with a specific version of Java
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Run tests
run: bundle exec fastlane android test

- name: Decode Service Account Key JSON File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: "serviceAccount.json"
encodedString: ${{ secrets.PLAY_STORE_CREDENTIALS }}

- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.KEYSTORE }}

- name: Build & deploy Android release
run: bundle exec fastlane android beta
env:
ANDROID_KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS}}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY: ${{ steps.service_account_json_file.outputs.filePath }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: assets
path: |
${{ github.workspace }}/app/build/outputs/bundle/release
63 changes: 63 additions & 0 deletions .github/workflows/build-production-upload-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Android Build & Deploy (Production)

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
bundler-cache: true

- name: Initialize local properties
env:
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
CMS_API_KEY: ${{ secrets.CMS_API_KEY }}
run: echo MAPS_API_KEY="$MAPS_API_KEY" >> ./local.properties ; echo CMS_API_KEY="$CMS_API_KEY" >> ./local.properties

# Set up your GitHub Actions workflow with a specific version of Java
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Run tests
run: bundle exec fastlane android test

- name: Decode Service Account Key JSON File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: "serviceAccount.json"
encodedString: ${{ secrets.PLAY_STORE_CREDENTIALS }}

- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.KEYSTORE }}

- name: Build & deploy Android release
run: bundle exec fastlane android deploy
env:
ANDROID_KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS}}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY: ${{ steps.service_account_json_file.outputs.filePath }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: assets
path: |
${{ github.workspace }}/app/build/outputs/bundle/release
27 changes: 23 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,31 @@ on:
branches: [ "main", dev ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ "main", dev ]
schedule:
- cron: '15 22 * * 3'

jobs:
duplicate_job_check:
name: Check for Duplicate Job
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**"]'
do_not_skip: '["workflow_dispatch", "schedule"]'

analyze:
needs: duplicate_job_check
if: needs.duplicate_job_check.outputs.should_skip != 'true'
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand All @@ -44,9 +63,9 @@ jobs:

- name: Initialize local properties
env:
API_KEY: ${{ secrets.MAPS_API_KEY }}
run: echo MAPS_API_KEY="$MAPS_API_KEY" > ./local.properties ; echo CMS_API_KEY="$CMS_API_KEY" > ./local.properties

MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
CMS_API_KEY: ${{ secrets.CMS_API_KEY }}
run: echo MAPS_API_KEY="$MAPS_API_KEY" >> ./local.properties ; echo CMS_API_KEY="$CMS_API_KEY" >> ./local.properties

# Set up your GitHub Actions workflow with a specific version of Java
- name: Setup Java JDK
Expand Down
21 changes: 11 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.781.0)
aws-sdk-core (3.175.0)
aws-partitions (1.782.0)
aws-sdk-core (3.176.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.67.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sdk-kms (1.68.0)
aws-sdk-core (~> 3, >= 3.176.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.126.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sdk-s3 (1.127.0)
aws-sdk-core (~> 3, >= 3.176.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
Expand Down Expand Up @@ -209,10 +209,11 @@ GEM
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
arm64-darwin-22
arm64-darwin-21
x86_64-linux

DEPENDENCIES
fastlane

BUNDLED WITH
2.4.10
2.4.14
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Feel free to request features or suggestions for improvements.
- Everywhere dark mode support
- A lot of Ready to use compositions
- Gradle Kotlin DSL
- CI/CD
- ktlint
- CodeQL
- Publish to Google Play
- Material 3 examples
- Animated Splash Screen (Introduced in Android 12)

[<img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" style="width:256px">](https://play.google.com/store/apps/details?id=org.imaginativeworld.whynotcompose)

Expand Down Expand Up @@ -71,11 +77,6 @@ Feel free to request features or suggestions for improvements.
- [x] Add compose BOM: https://developer.android.com/jetpack/androidx/releases/compose
- [x] Refactor to Gradle Plugins
- [x] Add notification permission
- [x] Animated Splash Screen (Introduced in Android 12)
- Add GitHub actions
- [x] ktlint
- [x] CodeQL
- [ ] Publish to Google Play
- Migrate to Material 3
- [x] CMS
- [ ] Full app
Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
applicationId = "org.imaginativeworld.whynotcompose"
minSdk = BuildConfigConst.minSdk
targetSdk = BuildConfigConst.targetSdk
versionCode = 3
versionName = "5.0.0.230628" // Major.Minor.Patch.YYMMDD
versionCode = (findProperty("android.injected.version.code") as? String)?.toIntOrNull() ?: 1
versionName = "5.0.0.${getCurrentDateAsYYMMDD()}" // Major.Minor.Patch.YYMMDD
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -162,7 +162,6 @@ dependencies {
// Accompanist
implementation(Libs.Accompanist.systemuicontroller)
implementation(Libs.Accompanist.flowlayout)
implementation(Libs.Accompanist.pager)
implementation(Libs.Accompanist.swipeRefresh)
implementation(Libs.Accompanist.placeholder)

Expand Down
11 changes: 10 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@
# uCrop
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }

# Compose tracing
# https://medium.com/androiddevelopers/jetpack-compose-composition-tracing-9ec2b3aea535
-assumenosideeffects public class androidx.compose.runtime.ComposerKt {
boolean isTraceInProgress();
void traceEventStart(int,int,int,java.lang.String);
void traceEventStart(int,java.lang.String);
void traceEventEnd();
}
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,10 @@ private fun NavGraphBuilder.addTutorialIndexScreen(
val viewModel: TicTacToeViewModel = hiltViewModel()

TicTacToeScreen(
viewModel = viewModel
viewModel = viewModel,
goBack = {
navController.popBackStack()
}
)
}

Expand All @@ -849,7 +852,11 @@ private fun NavGraphBuilder.addTutorialIndexScreen(
}

composable(TutorialsScreen.TutorialExoPlayer.route) {
ExoPlayerScreen()
ExoPlayerScreen(
goBack = {
navController.popBackStack()
}
)
}

composable(TutorialsScreen.TutorialCMS.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ fun AnimationIndexSkeleton(
goBack = goBack
)

Divider()

LazyColumn(Modifier.fillMaxSize()) {
itemsIndexed(Animation.animationList) { index, item ->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.imaginativeworld.whynotcompose.base.extensions.toWords
import org.imaginativeworld.whynotcompose.common.compose.compositions.AppComponent
import org.imaginativeworld.whynotcompose.common.compose.theme.AppTheme
Expand Down Expand Up @@ -102,7 +101,6 @@ fun BadgeScreenSkeleton(
.padding(innerPadding)
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(start = 16.dp, end = 16.dp)
) {
AppComponent.Header(
"Badge",
Expand Down
Loading

0 comments on commit a61fe5f

Please sign in to comment.