Skip to content

Signed APK + Auto-upload release from Build workflow#4

Merged
capy-ai[bot] merged 1 commit intomasterfrom
capy/cap-1-1e038a93
Oct 4, 2025
Merged

Signed APK + Auto-upload release from Build workflow#4
capy-ai[bot] merged 1 commit intomasterfrom
capy/cap-1-1e038a93

Conversation

@lavilao
Copy link
Copy Markdown
Owner

@lavilao lavilao commented Oct 4, 2025

  • Sign release APK with temporary CI keystore (v1+v2) so it installs on devices like Redmi 9A.\n- Integrate GitHub Release upload into Build App workflow when the ref is a tag.\n- Remove separate release workflow to avoid duplication.\n- No secret keystore required; APKs are installable but not update-compatible across different keys (fine for CI test builds).

… (v1+v2) and auto-upload to Releases when building tags. Remove separate release workflow; integrate upload into build.
@lavilao lavilao added the capy PR created by Capy label Oct 4, 2025
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @lavilao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant enhancements to the application's build process, primarily focusing on enabling signed APK generation within the CI environment. It configures the app/build.gradle file to conditionally apply signing configurations for release builds, utilizing environment variables for keystore details. This change aims to ensure that release APKs are properly signed for broader device compatibility and sets the stage for streamlining the CI/CD pipeline by integrating release uploads directly into the build workflow.

Highlights

  • APK Signing: Implemented conditional signing for release APKs using a temporary CI keystore, enabling installation on devices like Redmi 9A. This supports both v1 and v2 signing schemes.
  • CI Workflow Integration: The signing configuration is driven by environment variables, allowing for flexible integration within CI/CD pipelines without requiring a secret keystore for basic test builds.
  • Workflow Streamlining: This change supports the integration of GitHub Release uploads directly into the main build workflow when a tag is pushed, and facilitates the removal of a separate, redundant release workflow.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@capy-ai capy-ai bot merged commit 41a5a0c into master Oct 4, 2025
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds APK signing to the Gradle build process, conditional on the presence of environment variables, and cleans up some comments. My review focuses on improving the robustness and readability of the new signing logic. I've suggested a change to ensure all required signing environment variables are present before attempting to configure signing, which will prevent potential build failures and make the script more maintainable.

Comment thread app/build.gradle
Comment on lines +26 to +38
def hasSigning = System.getenv("SIGNING_STORE_FILE") != null
if (hasSigning) {
signingConfigs {
release {
storeFile file(System.getenv("SIGNING_STORE_FILE"))
storePassword System.getenv("SIGNING_STORE_PASSWORD")
keyAlias System.getenv("SIGNING_KEY_ALIAS")
keyPassword System.getenv("SIGNING_KEY_PASSWORD")
v1SigningEnabled true
v2SigningEnabled true
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation checks only for SIGNING_STORE_FILE to decide if signing is enabled, which could lead to build failures if other necessary signing variables are missing. Additionally, System.getenv() is called multiple times for the same variables. You can improve this by fetching all environment variables into a map, checking for their presence, and then using the map to configure signing. This makes the code more robust, readable, and easier to maintain.

    def signingProps = [
        storeFile: System.getenv("SIGNING_STORE_FILE"),
        storePassword: System.getenv("SIGNING_STORE_PASSWORD"),
        keyAlias: System.getenv("SIGNING_KEY_ALIAS"),
        keyPassword: System.getenv("SIGNING_KEY_PASSWORD")
    ]
    def hasSigning = signingProps.every { it.value != null }
    if (hasSigning) {
        signingConfigs {
            release {
                storeFile file(signingProps.storeFile)
                storePassword signingProps.storePassword
                keyAlias signingProps.keyAlias
                keyPassword signingProps.keyPassword
                v1SigningEnabled true
                v2SigningEnabled true
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy PR created by Capy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants