Skip to content

Publish Compose sample APK as a stable GitHub release asset#6565

Open
aleksandar-apostolov wants to merge 4 commits into
developfrom
feature/attach-sample-apk-to-release
Open

Publish Compose sample APK as a stable GitHub release asset#6565
aleksandar-apostolov wants to merge 4 commits into
developfrom
feature/attach-sample-apk-to-release

Conversation

@aleksandar-apostolov

@aleksandar-apostolov aleksandar-apostolov commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1307 — the website needs a permanent download link that always points to the newest Chat Compose sample APK. GitHub's releases/latest/download/<file> permalink delivers that, but only if every release carries an asset under a constant filename.

Implementation

  • New workflow attach-release-apk.yml, triggered by release: published — the event the build-conventions release workflow already emits (it publishes via a bot PAT, so the event fires). No change to the shared build-conventions repo.
  • Checks out the release tag, decrypts the release keystore (steps reused from app-distribute.yml), builds :stream-chat-android-compose-sample:assembleDemoRelease.
  • Uploads the signed APK with gh release upload --clobber, renaming the asset to stream-chat-android-sample.apk so the download URL stays constant across releases.
  • Resulting stable link: https://github.com/GetStream/stream-chat-android/releases/latest/download/stream-chat-android-sample.apk. Prerelease/suffix builds correctly don't move latest.

Testing

Not fully verifiable here — the release: published trigger and asset path can only be confirmed on the first real published release after merge. Build/sign steps are copied verbatim from the working app-distribute.yml compose job, and the assembleDemoRelease task + apk/demo/release/...-demo-release.apk output path were confirmed against the module's demo/e2e product flavors.

Summary by CodeRabbit

  • New Features
    • Added automated release handling that builds the Compose sample demo APK when a release is published.
    • Automatically attaches the signed APK to the corresponding release for download.

Publish the compose demo APK as a release asset under a constant
filename so the website can link a stable latest/download URL.
Triggered by the release published event emitted by the
build-conventions release workflow.
@aleksandar-apostolov aleksandar-apostolov added the pr:ci CI changes label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.94 MB 5.94 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.21 MB 11.21 MB 0.00 MB 🟢
stream-chat-android-compose 12.68 MB 12.68 MB 0.00 MB 🟢

Comment thread .github/workflows/attach-release-apk.yml Fixed
Comment thread .github/workflows/attach-release-apk.yml Fixed
Comment thread .github/workflows/attach-release-apk.yml Fixed
Comment thread .github/workflows/attach-release-apk.yml Fixed
Comment thread .github/workflows/attach-release-apk.yml Fixed
@aleksandar-apostolov aleksandar-apostolov marked this pull request as ready for review July 10, 2026 12:03
@aleksandar-apostolov aleksandar-apostolov requested a review from a team as a code owner July 10, 2026 12:03
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a GitHub Actions workflow that triggers when a release is published, builds the signed Compose demo APK from the release tag, and uploads it to that release.

Changes

Release APK publishing

Layer / File(s) Summary
Build and upload release APK
.github/workflows/attach-release-apk.yml
Configures release-triggered execution, tag-based concurrency, Java setup, GPG decryption of signing assets, Gradle APK assembly, and release upload with a fixed filename.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops through workflows bright,
With keys tucked safely out of sight.
It builds an APK, neat and spry,
Then pins it to releases in the sky.
“Ship it!” twitches every ear tonight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the new workflow that uploads the Compose sample APK as a stable release asset.
Description check ✅ Passed The description covers goal, implementation, and testing, matching the template's core sections.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/attach-sample-apk-to-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/attach-release-apk.yml:
- Around line 19-21: Update the actions/checkout step in the release APK
workflow to set persist-credentials: false, preventing the checkout token from
being written to .git/config before executing release-tag build logic. Set
fetch-depth: 0 as well if the Gradle build requires full repository history.
- Around line 36-38: Update the release upload step containing gh release upload
to pass github.event.release.tag_name through an environment variable, then
reference that variable in the shell command instead of interpolating the GitHub
expression directly; preserve the existing APK path and --clobber option.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 281ff857-b8bf-49e1-b3f1-6b6b761eafef

📥 Commits

Reviewing files that changed from the base of the PR and between 5a468b4 and d024e82.

📒 Files selected for processing (1)
  • .github/workflows/attach-release-apk.yml

Comment thread .github/workflows/attach-release-apk.yml Outdated
Comment thread .github/workflows/attach-release-apk.yml Outdated
Avoids expanding secrets directly in the run block (SonarCloud
findings); pass them as step env vars referenced as shell variables.
Set persist-credentials: false so the checkout token is not written to
.git/config while building from the release tag, and fetch full history
via fetch-depth: 0 instead of an authenticated post-checkout fetch. Pass
the release tag through an env var to avoid shell injection from
attacker-controllable tag names.
@sonarqubecloud

Copy link
Copy Markdown

name: Build and attach Compose sample APK
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6

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.

nit: we can use v7, otherwise dependabot will try to bump it later

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

Labels

pr:ci CI changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants