Skip to content

Apk versiong + download apk from google play#1719

Merged
meladRaouf merged 7 commits into
release/2026.2.1from
apk-versiong
Jun 24, 2026
Merged

Apk versiong + download apk from google play#1719
meladRaouf merged 7 commits into
release/2026.2.1from
apk-versiong

Conversation

@meladRaouf

Copy link
Copy Markdown
Collaborator
  1. APK versioning improvements (cherry-picked from main
  2. Download universal APK and create a draft GitHub release

…-build-apk.yml

- Extract version code generation and validation into a reusable shell script
- Add unit tests for the version generation script
- Add test-version-generation workflow

Cherry-picked from 23a5f42 and 27741c1
…release

- Add reusable-upload-to-internal-and-release.yml: uploads AAB via
  TianchenWei/upload-aab-google-play, downloads the Play-signed universal
  APK, and creates a draft GitHub release with the APK attached
- Update pipeline-deploy-to-internal.yml: replace deploy-internal-build
  and tag-release jobs with the new upload-to-internal-and-release job

Copilot AI left a comment

Copy link
Copy Markdown

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 improves CI-driven APK/AAB versioning by moving version-code/name computation into a dedicated script (with a matching test suite), and extends the internal deployment pipeline to upload an Internal AAB to Google Play and attach the resulting universal APK to a draft GitHub release.

Changes:

  • Add generate-version.sh plus test-generate-version.sh, and a workflow to run the tests.
  • Update the reusable build workflow to validate version names and compute VERSION_CODE via the new script.
  • Replace the internal deploy pipeline’s promote/tag steps with a reusable workflow that uploads to Play Internal, downloads the universal APK, and creates a draft GitHub release.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/test-version-generation.yml Adds a workflow to run the version-generation script tests on demand and on script changes.
.github/workflows/reusable-upload-to-internal-and-release.yml New reusable workflow to upload an AAB to Play Internal, fetch the universal APK, and draft a GitHub release.
.github/workflows/reusable-build-apk.yml Switches version computation to generate-version.sh and documents the new version-code formula.
.github/workflows/pipeline-deploy-to-internal.yml Rewires the internal pipeline to use the new upload-and-release reusable workflow.
.github/scripts/test-generate-version.sh Adds a bash test suite covering valid/invalid version names and rerun constraints.
.github/scripts/generate-version.sh Implements version-name validation and deterministic version-code/file-name generation.

Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Outdated
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Outdated
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
… workflow

- Mask the derived base64 credential with ::add-mask:: to prevent it
  leaking in debug logs; use printf instead of echo to avoid content
  mangling
- Pin TianchenWei/upload-aab-google-play to commit SHA
  1b070738058f58636b4a5c92ece8bc89fc7e4910 (main) instead of the
  moving branch ref to prevent unreviewed breaking changes
inputs.version-name and inputs.mapping-file were interpolated directly
into run scripts, allowing script injection if the workflow is triggered
with crafted values. Move all user-controlled inputs and step outputs to
env: so they are referenced as shell variables instead.
Comment thread .github/scripts/test-generate-version.sh
Comment thread .github/workflows/reusable-build-apk.yml Outdated
mapping-file:
description: "Optional artifact name of the ProGuard mapping file"
type: string
required: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be required?

Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Outdated
Cover the 4-digit/5-digit boundary (9999 → 10000) and a large 5-digit
run number (99999) to confirm VERSION_CODE is computed correctly when
run_number exceeds four digits.
The formula and re-run policy are already documented in
generate-version.sh, which is the single source of truth.
Keeping a copy in the workflow risks the two drifting apart.
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Dismissed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
Comment thread .github/workflows/reusable-upload-to-internal-and-release.yml Fixed
…load script

TianchenWei/upload-aab-google-play is an unmaintained personal repo.
Replace it with:
- r0adkll/upload-google-play@v1 (already used in reusable-promote-artifact)
  for uploading the AAB to the internal track
- download-universal-apk.py (our own script) for fetching the Play-signed
  universal APK

Also expose version-code as an output of reusable-build-apk.yml so the
download script can look up the correct APK in the Play generatedApks API.
@sonarqubecloud

Copy link
Copy Markdown


- name: Install Python dependencies
run: |
pip install --only-binary :all: "google-api-python-client==2.197.0" "google-auth==2.55.0"
@meladRaouf meladRaouf merged commit 9fa1336 into release/2026.2.1 Jun 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants