Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 4, 2025

This PR implements a comprehensive GitHub Actions CI/CD pipeline for automated building and releasing of Android APK artifacts.

Features Added

🚀 Release Workflow (.github/workflows/release.yml)

  • Triggers on:
    • Git tags starting with v* (e.g., v2.0, v2.1)
    • Push to release/* branches
    • Manual GitHub releases
  • Builds optimized release APK with ProGuard/R8 enabled
  • Automatically uploads APK to GitHub releases with version-based naming
  • Creates releases automatically for version tags with changelog

🔧 CI Workflow (.github/workflows/ci.yml)

  • Runs on push/PR to main branches (master, main, develop)
  • Executes unit tests via ./gradlew test
  • Builds debug APK and uploads as artifact for verification

📚 Documentation & Monitoring

  • Added comprehensive CI/CD documentation to README
  • Included workflow status badges for build visibility
  • Provided clear instructions for creating releases via tags, branches, or manual process

Technical Implementation

  • Environment: Ubuntu latest with JDK 17 and Android SDK
  • Caching: Gradle dependencies cached for faster builds
  • Error Handling: Comprehensive verification and stacktrace output
  • Security: Uses GITHUB_TOKEN for authenticated GitHub operations
  • Modern Tooling: Uses GitHub CLI for release management

Usage Examples

Create a new release by pushing a version tag:

git tag v2.1
git push origin v2.1

Or create a release branch:

git checkout -b release/v2.1
git push origin release/v2.1

The pipeline will automatically build the APK and publish it to the GitHub releases page.

Fixes #4.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 4, 2025 23:27
Co-authored-by: simonvar <10325034+simonvar@users.noreply.github.com>
Co-authored-by: simonvar <10325034+simonvar@users.noreply.github.com>
Copilot AI changed the title [WIP] Make a github ci Add GitHub CI/CD pipeline for automated APK builds and releases Jul 4, 2025
Copilot AI requested a review from simonvar July 4, 2025 23:30
Co-authored-by: simonvar <10325034+simonvar@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 4, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from simonvar July 4, 2025 23:51
@simonvar simonvar marked this pull request as ready for review July 4, 2025 23:57
@simonvar simonvar requested a review from Copilot July 4, 2025 23:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements automated CI and CD for the Android app by adding GitHub Actions workflows, updating build dependencies, and enhancing README documentation.

  • Adds unit and instrumentation test dependencies in app/build.gradle
  • Introduces a CI workflow to run tests and build/upload debug APKs
  • Introduces a release workflow to build, verify, and publish release APKs
  • Updates README with badges and usage instructions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
app/build.gradle Added testImplementation and androidTestImplementation dependencies
README.md Documented CI/CD pipeline, added workflow badges
.github/workflows/release.yml New workflow to assemble and publish release APK
.github/workflows/ci.yml New workflow to run unit tests and assemble debug APK
Comments suppressed due to low confidence (5)

app/build.gradle:74

  • You added Android instrumentation test dependencies but the CI workflow doesn't install an emulator or run connectedAndroidTest. Consider adding emulator setup and an instrumentation test step in the CI workflow or removing unused dependencies.
    testImplementation 'junit:junit:4.13.2'

.github/workflows/release.yml:47

  • Checking for an APK with a glob in -f may not behave as expected if no files match or multiple files exist. Consider using the captured APK_PATH variable in an -f "$APK_PATH" check for more reliable validation.
        if [ ! -f app/build/outputs/apk/release/*.apk ]; then

.github/workflows/release.yml:27

  • The setup-android action installs only basic SDK components by default. Explicitly install required SDK platforms and build-tools (e.g., via sdkmanager 'platforms;android-31' 'build-tools;31.0.0') to ensure consistent builds.
      uses: android-actions/setup-android@v3

.github/workflows/ci.yml:24

  • Similarly, in the CI workflow you should explicitly install your project's target SDK and build-tools via sdkmanager to avoid missing component errors during the debug build.
      uses: android-actions/setup-android@v3

.github/workflows/ci.yml:46

  • [nitpick] The debug APK upload step only runs on push events. You may want to also upload artifacts for pull_request events so reviewers can download the APK generated by PRs.
      if: github.event_name == 'push'

@simonvar simonvar merged commit 3a91135 into master Jul 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a github ci

2 participants