Skip to content

Commit

Permalink
Add CI (#3)
Browse files Browse the repository at this point in the history
* Add codemagic.yaml for CI/CD to publish app bundle to Google Play.

Signed-off-by: Dmytro Turskyi <[email protected]>

* Add scan page screenshot

Signed-off-by: Dmytro Turskyi <[email protected]>

* Update build.gradle for CI signing configuration

Refactored key properties loading to a single line for clarity.
Introduced conditional signing configs in the Android build script to
support automated builds on Codemagic CI. Locally, the build continues
to use existing signing key properties, while the CI environment
variables are now used for release signing when the build is run in the
Codemagic environment. This change enables a seamless CI/CD pipeline and
distinct handling of signing configurations for development and
continuous integration.

---------

Signed-off-by: Dmytro Turskyi <[email protected]>
  • Loading branch information
Turskyi authored Jan 7, 2024
1 parent 603cc2f commit 661494e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

[![Codemagic build status](https://api.codemagic.io/apps/659998e6caf611b8969ad389/659998e6caf611b8969ad388/status_badge.svg)](https://codemagic.io/apps/659998e6caf611b8969ad389/659998e6caf611b8969ad388/latest_build)
# Ethical Scanner

Ethical Scanner is a Flutter project for Android and iOS mobile application that scans the barcode
of a product and tells you if the product meets your ethical standards.

Expand Down Expand Up @@ -393,3 +392,5 @@ name and ethical status.
<img src="screenshots/home_android_tablet_portrait_20240106.png" width="400" alt="screenshot">
<!--suppress CheckImageSize -->
<img src="screenshots/home_android_phone_portrait_20240106.png" width="400" alt="screenshot">
<!--suppress CheckImageSize -->
<img src="screenshots/scan_android_phone_portrait_20240106.png" width="400" alt="screenshot">
19 changes: 13 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ if (flutterVersionName == null) {
def keyProperties = new Properties()
def keyPropertiesFile = rootProject.file('key.properties')
if (keyPropertiesFile.exists()) {
keyPropertiesFile.withReader('UTF-8') { reader ->
keyProperties.load(reader)
keyPropertiesFile.withReader('UTF-8') { reader -> keyProperties.load(reader)
}
}

Expand Down Expand Up @@ -70,10 +69,18 @@ android {
}
signingConfigs {
production {
storeFile file(SIGNING_KEY_RELEASE_PATH)
storePassword SIGNING_KEY_RELEASE_PASSWORD
keyAlias SIGNING_KEY_RELEASE_KEY
keyPassword SIGNING_KEY_RELEASE_KEY_PASSWORD
// CI=true is exported by Codemagic
if (System.getenv()["CI"]) {
storeFile file(System.getenv()["CM_KEYSTORE_PATH"])
storePassword System.getenv()["CM_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["CM_KEY_ALIAS"]
keyPassword System.getenv()["CM_KEY_PASSWORD"]
} else {
storeFile file(SIGNING_KEY_RELEASE_PATH)
storePassword SIGNING_KEY_RELEASE_PASSWORD
keyAlias SIGNING_KEY_RELEASE_KEY
keyPassword SIGNING_KEY_RELEASE_KEY_PASSWORD
}
}
dev {
storeFile file(SIGNING_KEY_DEBUG_PATH)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 661494e

Please sign in to comment.