From fa05dca70f0de96489bea2df7923d0f8bda69b91 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Thu, 1 May 2025 23:52:19 +0530 Subject: [PATCH 1/7] chore: setup fastlane --- .gitignore | 3 +- Gemfile | 4 + Gemfile.lock | 231 +++++++++++++++++++++++++++++++++++++++++++++ fastlane/Fastfile | 38 ++------ fastlane/README.md | 48 ++++++++++ 5 files changed, 290 insertions(+), 34 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 fastlane/README.md diff --git a/.gitignore b/.gitignore index 21da4996..d209458c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,4 @@ keystore.jks keystore.properties fastlane/fastlane.json -Gemfile -Gemfile.lock +fastlane/report.xml diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..34b05736 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "fastlane" +gem "fastlane-plugin-fossify", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..d4ed537a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,231 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.7) + base64 + nkf + rexml + abbrev (0.1.2) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + artifactory (3.0.17) + atomos (0.1.3) + aws-eventstream (1.3.2) + aws-partitions (1.1095.0) + aws-sdk-core (3.222.3) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + jmespath (~> 1, >= 1.6.1) + logger + aws-sdk-kms (1.99.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.184.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.2.0) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20240107) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.112.0) + faraday (1.10.4) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.1) + faraday (~> 1.0) + fastimage (2.4.0) + fastlane (2.227.1) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored (~> 1.2) + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (>= 0.1.1, < 1.0.0) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.5) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.4.1) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-plugin-fossify (1.0.0) + abbrev + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.8.0) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.5.0) + google-cloud-storage (1.47.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.31.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.8) + domain_name (~> 0.5) + httpclient (2.9.0) + mutex_m + jmespath (1.6.2) + json (2.11.3) + jwt (2.10.1) + base64 + logger (1.7.0) + mini_magick (4.13.2) + mini_mime (1.1.5) + multi_json (1.15.0) + multipart-post (2.4.1) + mutex_m (0.3.0) + nanaimo (0.4.0) + naturally (2.2.1) + nkf (0.2.0) + optparse (0.6.0) + os (1.1.4) + plist (3.7.2) + public_suffix (6.0.2) + rake (13.2.1) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.4.1) + rouge (3.28.0) + ruby2_keywords (0.0.5) + rubyzip (2.4.1) + security (0.1.5) + signet (0.20.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + sysrandom (1.0.5) + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (2.6.0) + word_wrap (1.0.0) + xcodeproj (1.27.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + fastlane + fastlane-plugin-fossify (~> 1.0) + +BUNDLED WITH + 2.6.8 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 19c557cc..947a642c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,38 +1,12 @@ -# This file contains the fastlane.tools configuration -# You can find the documentation at https://docs.fastlane.tools -# -# For a list of all available actions, check out -# -# https://docs.fastlane.tools/actions -# -# For a list of all available plugins, check out -# -# https://docs.fastlane.tools/plugins/available-plugins -# - -# Uncomment the line if you want fastlane to automatically update itself -# update_fastlane - default_platform(:android) platform :android do - desc "Runs all the tests" - lane :test do - gradle(task: "test") - end + desc 'Run unit & instrumentation tests' + lane(:test) { test_android } - desc "Submit a new Beta Build to Crashlytics Beta" - lane :beta do - gradle(task: "clean assembleRelease") - crashlytics - - # sh "your_script.sh" - # You can also use other beta testing services here - end + desc 'Build & deploy AAB to Google Play (includes metadata)' + lane(:deploy) { deploy_android } - desc "Deploy a new version to the Google Play" - lane :deploy do - gradle(task: "clean assembleRelease") - upload_to_play_store - end + desc 'Push Play Store metadata' + lane(:metadata) { metadata_android } end diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 00000000..29777e78 --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,48 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## Android + +### android test + +```sh +[bundle exec] fastlane android test +``` + +Run unit & instrumentation tests + +### android deploy + +```sh +[bundle exec] fastlane android deploy +``` + +Build & deploy AAB to Google Play (includes metadata) + +### android metadata + +```sh +[bundle exec] fastlane android metadata +``` + +Push Play Store metadata + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). From 176d2b8776ea3056ef7d76d31a04bcc4dfd78158 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sat, 3 May 2025 08:30:45 +0530 Subject: [PATCH 2/7] refactor(build): rename prepaid product flavor to gplay --- app/.gitignore | 2 +- app/build.gradle.kts | 2 +- app/src/{prepaid => gplay}/res/values/bools.xml | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename app/src/{prepaid => gplay}/res/values/bools.xml (100%) diff --git a/app/.gitignore b/app/.gitignore index fdc4913f..08121cfd 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,3 +1,3 @@ /build /foss/ -/prepaid/ +/gplay/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d132cdb4..8f27b25e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -69,7 +69,7 @@ android { productFlavors { register("core") register("foss") - register("prepaid") + register("gplay") } sourceSets { diff --git a/app/src/prepaid/res/values/bools.xml b/app/src/gplay/res/values/bools.xml similarity index 100% rename from app/src/prepaid/res/values/bools.xml rename to app/src/gplay/res/values/bools.xml From 1771b7f65716d3dc6daa39b7f606ec4382af6d1e Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sat, 3 May 2025 09:20:51 +0530 Subject: [PATCH 3/7] build: use env variables for release signing fallback --- app/build.gradle.kts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8f27b25e..580f264d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -40,6 +40,13 @@ android { storeFile = file(keystoreProperties.getProperty("storeFile")) storePassword = keystoreProperties.getProperty("storePassword") } + } else { + register("release") { + keyAlias = System.getenv("SIGNING_KEY_ALIAS") + keyPassword = System.getenv("SIGNING_KEY_PASSWORD") + storeFile = file(System.getenv("SIGNING_STORE_FILE")) + storePassword = System.getenv("SIGNING_STORE_PASSWORD") + } } } @@ -59,9 +66,7 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - if (keystorePropertiesFile.exists()) { - signingConfig = signingConfigs.getByName("release") - } + signingConfig = signingConfigs.getByName("release") } } From 1f4a378c1ffeccf2b6a5a30ad17c63baee62c022 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sat, 3 May 2025 12:30:59 +0530 Subject: [PATCH 4/7] style: reformat changelogs as per Keep a Changelog --- CHANGELOG.md | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e325f524..e7e63290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,39 @@ -Changelog -========== +# Changelog -Version 1.1.1 *(2024-10-28)* ----------------------------- +All notable changes to this project will be documented in this file. -* Fixed keyboard crash on lock screen -* Added more translations +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -Version 1.1.0 *(2024-10-25)* ----------------------------- +## [Unreleased] -* Fixed keyboard crash on lock screen -* Fixed sticky keys -* Replaced checkboxes with switches -* Removed support for Android 7 and below versions -* Added more translations +## [1.1.1] - 2024-10-28 -Version 1.0.0 *(2024-07-18)* ----------------------------- +### Changed +- Added more translations -* Initial release +### Fixed +- Fixed keyboard crash on lock screen + +## [1.1.0] - 2024-10-25 + +### Changed +- Replaced checkboxes with switches +- Added more translations + +### Fixed +- Fixed keyboard crash on lock screen +- Fixed sticky keys + +### Removed +- Removed support for Android 7 and below versions + +## [1.0.0] - 2024-07-18 + +### Added +- Initial release + +[Unreleased]: https://github.com/FossifyOrg/Keyboard/compare/1.1.1...HEAD +[1.1.1]: https://github.com/FossifyOrg/Keyboard/compare/1.1.0...1.1.1 +[1.1.0]: https://github.com/FossifyOrg/Keyboard/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/FossifyOrg/Keyboard/releases/tag/1.0.0 From 01457e6845911e19280c7c693bd45720b37b3f8d Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sat, 3 May 2025 19:22:20 +0530 Subject: [PATCH 5/7] ci: setup release workflow --- .github/workflows/foss-release.yml | 25 ++++++++++++++++ .github/workflows/gplay-release.yml | 46 +++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/foss-release.yml create mode 100644 .github/workflows/gplay-release.yml diff --git a/.github/workflows/foss-release.yml b/.github/workflows/foss-release.yml new file mode 100644 index 00000000..4d45ac3a --- /dev/null +++ b/.github/workflows/foss-release.yml @@ -0,0 +1,25 @@ +name: Github Release + +on: + push: + tags: + - "*.*.*" + +permissions: + contents: read + +jobs: + call-release-workflow: + uses: FossifyOrg/.github/.github/workflows/release.yml@main + with: + tag: ${{ github.ref_name }} + flavor: "foss" + package_name: "org.fossify.keyboard" + + secrets: + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} + SERVICE_ACCOUNT_JSON_KEY_BASE64: "" + FOSSIFYBOT_TOKEN: ${{ secrets.FOSSIFYBOT_TOKEN }} diff --git a/.github/workflows/gplay-release.yml b/.github/workflows/gplay-release.yml new file mode 100644 index 00000000..d2500dc9 --- /dev/null +++ b/.github/workflows/gplay-release.yml @@ -0,0 +1,46 @@ +name: Google Play Release + +on: + workflow_dispatch: + inputs: + track: + description: "Google Play Store release track" + required: false + type: choice + default: "beta" + options: + - internal + - alpha + - beta + - production + rollout: + description: "Rollout fraction (0.0-1.0)" + required: false + type: string + default: "0.05" + validate_only: + description: "Fastlane dry-run?" + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + call-release-workflow: + uses: FossifyOrg/.github/.github/workflows/release.yml@main + with: + flavor: "gplay" + package_name: "org.fossify.keyboard" + track: ${{ github.event.inputs.track }} + rollout: ${{ github.event.inputs.rollout }} + validate_only: ${{ github.event.inputs.validate_only == 'true' }} + + secrets: + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} + SERVICE_ACCOUNT_JSON_KEY_BASE64: ${{ secrets.SERVICE_ACCOUNT_JSON_KEY_BASE64 }} + FOSSIFYBOT_TOKEN: "" From bcc2c1b61e769ce12e902bb0002b7aaeee5650de Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sun, 4 May 2025 13:56:06 +0530 Subject: [PATCH 6/7] build: allow builds without signing configuration --- app/build.gradle.kts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 580f264d..57045c1a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,6 +15,13 @@ if (keystorePropertiesFile.exists()) { keystoreProperties.load(FileInputStream(keystorePropertiesFile)) } +fun hasSigningVars(): Boolean { + return providers.environmentVariable("SIGNING_KEY_ALIAS").orNull != null + && providers.environmentVariable("SIGNING_KEY_PASSWORD").orNull != null + && providers.environmentVariable("SIGNING_STORE_FILE").orNull != null + && providers.environmentVariable("SIGNING_STORE_PASSWORD").orNull != null +} + android { compileSdk = project.libs.versions.app.build.compileSDKVersion.get().toInt() @@ -40,13 +47,15 @@ android { storeFile = file(keystoreProperties.getProperty("storeFile")) storePassword = keystoreProperties.getProperty("storePassword") } - } else { + } else if (hasSigningVars()) { register("release") { - keyAlias = System.getenv("SIGNING_KEY_ALIAS") - keyPassword = System.getenv("SIGNING_KEY_PASSWORD") - storeFile = file(System.getenv("SIGNING_STORE_FILE")) - storePassword = System.getenv("SIGNING_STORE_PASSWORD") + keyAlias = providers.environmentVariable("SIGNING_KEY_ALIAS").get() + keyPassword = providers.environmentVariable("SIGNING_KEY_PASSWORD").get() + storeFile = file(providers.environmentVariable("SIGNING_STORE_FILE").get()) + storePassword = providers.environmentVariable("SIGNING_STORE_PASSWORD").get() } + } else { + logger.warn("Warning: No signing config found. Build will be unsigned.") } } @@ -66,7 +75,9 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - signingConfig = signingConfigs.getByName("release") + if (keystorePropertiesFile.exists() || hasSigningVars()) { + signingConfig = signingConfigs.getByName("release") + } } } @@ -106,7 +117,6 @@ android { bundle { language { - @Suppress("UnstableApiUsage") enableSplit = false } } From 44ef2655b0b451ef7a9f251139521f43b275b6af Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Sun, 4 May 2025 16:00:19 +0530 Subject: [PATCH 7/7] ci: add dependabot config --- .github/dependabot.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5e8478d7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope" + + - package-ecosystem: "gradle" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope"