Skip to content

Commit

Permalink
chore: adding release apk (#9)
Browse files Browse the repository at this point in the history
* chore: adding release apk

* chore: update github actions

* chore: update keystore name

Co-authored-by: Kartik Shah <[email protected]>

* chore: linux eol

---------

Co-authored-by: Kartik Shah <[email protected]>
  • Loading branch information
siddhart1o1 and krtk6160 authored Apr 3, 2024
1 parent de10704 commit 880c8b9
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: ./gradlew lint

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew assembleDebug
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.externalNativeBuild
.cxx
local.properties
app/pos-keystore
10 changes: 10 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
create("release") {
keyAlias = "key0"
storeFile = file("pos-keystore")
keyPassword = "android"
storePassword = "android"
}
}

buildTypes {
release {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
10 changes: 10 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ resources:
bucket: #@ data.values.build_artifacts_bucket_name
json_key: #@ data.values.build_artifacts_bucket_creds
regexp: pos-print-companion/dev/android/pos-print-companion-(.+)-v.+/apk/debug/app-debug.apk
- name: built-release-apk
type: gcs-resource
source:
bucket: #@ data.values.build_artifacts_bucket_name
json_key: #@ data.values.build_artifacts_bucket_creds
regexp: pos-print-companion/dev/android/pos-print-companion-(.+)-v.+/apk/release/app-release.apk
- name: version
type: semver
source:
Expand Down Expand Up @@ -135,6 +141,8 @@ jobs:
- name: artifacts
run:
path: pipeline-tasks/ci/tasks/build.sh
params:
keystore: #@ data.values.keystore

- task: upload-to-gcs
config:
Expand All @@ -161,6 +169,7 @@ jobs:
- get: pipeline-tasks
- get: version
- get: built-dev-apk
- get: built-release-apk
- task: prep-release
config:
platform: linux
Expand All @@ -182,6 +191,7 @@ jobs:
body: artifacts/gh-release-notes.md
globs:
- built-dev-apk/app-debug.apk
- built-release-apk/app-release.apk
- put: version
params:
file: version/version
2 changes: 2 additions & 0 deletions ci/tasks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -eu

echo "$keystore" | base64 --decode > repo/app/pos-keystore

current_dir=$(pwd)
cd repo/
./gradlew build
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/upload-to-gcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ gcloud auth activate-service-account --key-file key.json

pushd artifacts

gsutil cp -r app/build/outputs/apk/debug/* gs://$bucket/pos-print-companion/$GCS_DIRECTORY/android/pos-print-companion-$(date +%s)-v${version}/apk/debug/
gsutil cp -r app/build/outputs/apk/* gs://$bucket/pos-print-companion/$GCS_DIRECTORY/android/pos-print-companion-$(date +%s)-v${version}/apk/
2 changes: 2 additions & 0 deletions ci/values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ gh_repository: pos-print-companion

build_artifacts_bucket_name: galoy-build-artifacts
build_artifacts_bucket_creds: ((build-artifacts-bucket-creds.creds_json))

keystore: ((pos-companion-keystore.keystore))

0 comments on commit 880c8b9

Please sign in to comment.