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

Automatic project build #14

Merged
merged 39 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
879af19
Delete .idea directory
vladalexeco Nov 23, 2023
a3589e0
1. Created key store cashadvisor.jks in KeyStore folder
JudjinGM Nov 27, 2023
18084c0
Create checkPRToDev.yml
JudjinGM Nov 27, 2023
a64d917
Merge remote-tracking branch 'origin/2-github-actions-check-pull-requ…
JudjinGM Nov 27, 2023
f4e5494
Made gradlew executable in checkPRToDev.yml
JudjinGM Nov 27, 2023
2b3d3a2
Changed java version to 17
JudjinGM Nov 27, 2023
d2731ae
Moved local properties init inside signingConfigs. Added blank value …
JudjinGM Nov 27, 2023
c255f4f
In action added build for all flavors and removed gradlew making exec…
JudjinGM Nov 27, 2023
e7d9868
Trying to add bit for executable
JudjinGM Nov 27, 2023
7b38d00
1. Added secrets access
JudjinGM Nov 27, 2023
6262882
Restored comments in yml
JudjinGM Nov 27, 2023
f1a344e
Changed yml? moved end variables into stem
JudjinGM Nov 28, 2023
4ac9a7d
Merge branch 'dev' into feature/13-automatic-project-build
JudjinGM Nov 28, 2023
175395e
printing secrets for debug purpose
JudjinGM Nov 28, 2023
c935bb5
syntax error fix
JudjinGM Nov 28, 2023
ea65852
trying to fix build by moving keystore
JudjinGM Nov 28, 2023
ebf8e78
trying to fix build by creating local.properties in actions
JudjinGM Nov 28, 2023
1fff4e6
trying to fix build by adding POST_NOTIFICATIONS permission to manife…
JudjinGM Nov 28, 2023
9d429f0
clean app
JudjinGM Nov 28, 2023
8750fbc
removed local.properties. using envoriment variables
JudjinGM Nov 28, 2023
fdb3ede
cleanup
JudjinGM Nov 28, 2023
3a71b09
Merge branch 'dev' into feature/13-automatic-project-build
JudjinGM Nov 29, 2023
5261305
Fix after merge. Now projects build and app sends to QA
JudjinGM Nov 29, 2023
c4b3837
1. Reverted back uikit build.gradle.kts changes.
JudjinGM Nov 29, 2023
7d09e13
1. Added yml for sendAppToQaAfterMergeProdQa.yml
JudjinGM Nov 29, 2023
394070a
Fixed mistake 1
JudjinGM Nov 29, 2023
f18e521
Fixed mistake 2
JudjinGM Nov 29, 2023
c2dbcb6
Fixed mistake 3
JudjinGM Nov 29, 2023
69cf822
Fixed mistake 4
JudjinGM Nov 29, 2023
8f67d49
Fixed mistake 5
JudjinGM Nov 29, 2023
190171b
Changed condition for action start: now it would start after closed p…
JudjinGM Nov 29, 2023
9475f7b
Changing version name of build.
JudjinGM Nov 29, 2023
89aa755
Fixing mistake 1
JudjinGM Nov 29, 2023
d365f13
Fixing mistake 2
JudjinGM Nov 29, 2023
fe43835
Fixing mistake 3
JudjinGM Nov 29, 2023
b59fc43
Reverted back
JudjinGM Nov 29, 2023
2442f1d
Reverted back action start in merge
JudjinGM Nov 29, 2023
e6578bd
1. Fixed comments in github scripts
JudjinGM Nov 30, 2023
a595577
Added condition what checks if pull request closed and also merged
JudjinGM Nov 30, 2023
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
31 changes: 31 additions & 0 deletions .github/workflows/checkPRToDev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check Pull Request to dev branch

on:
# Triggers the workflow on push or pull request events but only for the "dev" branch
pull_request:
branches: [ "dev" ]

workflow_dispatch:

jobs:
check_pull_request:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with: {java-version: 1.17}
- name: Build app
env:
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
./gradlew :app:build

- name: Check status
run: echo "Check build status"
- name: Set failed if build failed
if: failure()
run: |
echo "::error::Build failed"
38 changes: 38 additions & 0 deletions .github/workflows/sendAppToQaAfterMergeStageQa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and sent to QA stageQa

on:
avanisimov marked this conversation as resolved.
Show resolved Hide resolved
# Triggers the workflow when pull request closed events but only for the "dev" branch
pull_request:
types:
- closed
avanisimov marked this conversation as resolved.
Show resolved Hide resolved
branches: [ "dev" ]

workflow_dispatch:

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

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with: { java-version: 1.17 }
- name: Build and send application stageQa to App Distribution
env:
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
CREDENTIAL_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
run: |
echo "$CREDENTIAL_FILE_CONTENT" > ./app/serviceCredentialsFile.json
echo "App type: stageQa" >> ./app/src/releaseNotes.txt
echo "buildNumber=${GITHUB_RUN_NUMBER}" >> ./app/src/releaseNotes.txt
./gradlew appDistributionToQaStageQa

- name: Check status
run: echo "Check build status and send status"
- name: Set failed if build failed
if: failure()
run: |
echo "::error::Build or send build stageQa to App Distribution failed"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
/app/serviceCredentialsFile.json
61 changes: 39 additions & 22 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

import com.google.firebase.appdistribution.gradle.firebaseAppDistribution

plugins {
Expand All @@ -10,7 +12,6 @@ plugins {
alias(libs.plugins.firebase.crashlytics.gradle)
alias(libs.plugins.gms.googleServices)
alias(libs.plugins.firebase.appdistribution)

}

android {
Expand All @@ -26,40 +27,48 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
create("release") {

val localProperties = gradleLocalProperties(rootDir)

val storePasswordLocal: String =
System.getenv("STORE_PASSWORD") ?: localProperties.getProperty("storePassword")
?: "storePasswordEmpty"
val keyAliasLocal: String =
System.getenv("KEY_ALIAS") ?: localProperties.getProperty("keyAlias")
?: "keyAliasEmpty"
val keyPasswordLocal: String =
System.getenv("KEY_PASSWORD") ?: localProperties.getProperty("keyPassword")
?: "keyPasswordEmpty"

storeFile = file("keyStore/cashadvisor.jks")
storePassword = storePasswordLocal
keyAlias = keyAliasLocal
keyPassword = keyPasswordLocal
}
}

buildTypes {
getByName("debug") {
isDebuggable = true
applicationIdSuffix = ".debug"
matchingFallbacks += listOf("release")
}

create("qa") {
initWith(getByName("release"))
isMinifyEnabled = false
applicationIdSuffix = ".qa"
signingConfig = signingConfigs.getByName("debug")

}

firebaseAppDistribution{
artifactType = "APK"
releaseNotesFile = "app/src/stage/qa/releaseNotes.txt"
testers = "QA"
signingConfig = signingConfigs.getByName("release")
matchingFallbacks += listOf("release")
}

getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)

}

firebaseAppDistribution{
artifactType = "APK"
releaseNotesFile = "app/src/stage/qa/releaseNotes.txt"
testers = "QA"

signingConfig = signingConfigs.getByName("release")
}
}

Expand Down Expand Up @@ -88,12 +97,20 @@ android {
viewBinding = true
}
}
task("appDistirbutionToQaStageQa") {

firebaseAppDistribution {
artifactType = "APK"
releaseNotesFile = "app/src/releaseNotes.txt"
testers = "QA"
serviceCredentialsFile = "app/serviceCredentialsFile.json"
}

task("appDistributionToQaStageQa") {
dependsOn("assembleStageQa")
dependsOn("appDistributionUploadStageQa")
}

task("appDistirbutionToQaProdQa") {
task("appDistributionToQaProdQa") {
dependsOn("assembleProdQa")
dependsOn("appDistributionUploadProdQa")
}
Expand Down
Binary file added app/keyStore/cashadvisor.jks
Binary file not shown.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand Down
File renamed without changes.
Empty file modified gradlew
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions uikit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Loading