Skip to content

Commit 0308ef8

Browse files
authored
Distribute v2 demo app builds to Firebase App Distribution (#1813)
* Distribute v2 demo app builds to Firebase App Distribution Nothing was distributed from develop-v2, so the team had no way to test v2 work. Add a workflow that builds the demo app on every push to develop-v2 and uploads it to the stream-testers group in the shared stream-android-32afb Firebase project. The demo app google-services.json is left alone. It stays on stream-video-9b586 so push and Crashlytics keep working. App Distribution only needs the APK package name to match the registered app. * Fix the APK artifact path in the app distribution workflow The Upload APK step pointed at build/outputs/apk/demo-app/release, but AGP writes to build/outputs/apk/<flavor>/<buildType>, so the directory never existed. upload-artifact only warns when it finds no files, so the step passed and every run uploaded an empty artifact. * Harden the v2 distribution workflow Address the security findings from the automated review: - Drop the unused actions: write permission. The job only reads the repo and uploads an artifact. - Read the gpg passphrase from stdin instead of passing it as a command line argument, where it is visible in the process list. - Reference the secrets as shell variables rather than expanding them into the run script, which removes the template injection surface. - Delete the decrypted keystore, keystore properties and env properties right after the build, so they are gone before the third-party Firebase action runs. - Pin actions/upload-artifact to a commit SHA, matching how checkout and the Firebase action are already pinned. * TEMPORARY: run the v2 distribution workflow from this PR branch A push trigger reads the workflow file from the branch being pushed, and workflow_dispatch is not available until the file reaches the default branch. Adding this branch to the trigger is the only way to verify the pipeline end to end before it lands on develop-v2. Revert this commit before merging. * Remove the temporary PR branch trigger The pipeline was verified end to end from this branch in run 34132353521: the keystore decrypted, the development release APK was assembled and signed, the artifact uploaded, and the build was distributed to the stream-testers group in stream-android-32afb. The trigger has served its purpose, so the workflow now runs only on develop-v2. * Build only the distributed variant in the app distribution workflow assembleRelease built the release variant of all three flavors, but the job only uploads the development APK, so the e2etesting and production builds were discarded. Assemble just the development release instead. The Google Play pipeline is unaffected. internal-app-distribute.yml runs publishBundle, and its playConfigs only registers productionRelease.
1 parent 9008ff9 commit 0308ef8

2 files changed

Lines changed: 57 additions & 2 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: App Distribute CI v2
2+
3+
# Temporary workflow to publish the v2 demo app to Firebase App Distribution in the shared
4+
# stream-android-32afb project. When v2 is released and `develop-v2` becomes `develop`, remove
5+
# this workflow and update the main `app-distribute.yml` instead.
6+
7+
on:
8+
push:
9+
branches:
10+
- develop-v2
11+
workflow_dispatch:
12+
13+
jobs:
14+
build_v2_demo_app:
15+
permissions:
16+
contents: read
17+
name: Build and Distribute V2 Demo App
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
21+
- uses: GetStream/android-ci-actions/actions/setup-java@cb46e4f44d105a68738bfd2a1cfd156bb768665b
22+
- name: Prepare environment
23+
env:
24+
ENV_PROPERTIES: ${{ secrets.ENV_PROPERTIES }}
25+
PASSPHRASE: ${{ secrets.PASSPHRASE }}
26+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
27+
RELEASE_KEYSTORE_PROPERTIES: ${{ secrets.RELEASE_KEYSTORE_PROPERTIES }}
28+
run: |
29+
echo "$RELEASE_KEYSTORE" > .sign/release.keystore.asc
30+
gpg -d --batch --pinentry-mode loopback --passphrase-fd 0 \
31+
.sign/release.keystore.asc > .sign/release.keystore <<< "$PASSPHRASE"
32+
echo "$RELEASE_KEYSTORE_PROPERTIES" > .sign/keystore.properties.asc
33+
gpg -d --batch --pinentry-mode loopback --passphrase-fd 0 \
34+
.sign/keystore.properties.asc > .sign/keystore.properties <<< "$PASSPHRASE"
35+
echo "$ENV_PROPERTIES" > .env.properties
36+
- name: Assemble
37+
run: bash ./gradlew :demo-app:assembleDevelopmentRelease --stacktrace
38+
- name: Remove signing material
39+
if: always()
40+
run: |
41+
rm -f .sign/release.keystore .sign/release.keystore.asc \
42+
.sign/keystore.properties .sign/keystore.properties.asc \
43+
.env.properties
44+
- name: Upload APK
45+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
46+
with:
47+
name: demo-app-development-release
48+
path: demo-app/build/outputs/apk/development/release/
49+
- name: Upload artifact to Firebase App Distribution
50+
uses: wzieba/Firebase-Distribution-Github-Action@bd494989dd4bec0343f78adee87fe66e48279ad6
51+
with:
52+
appId: ${{ secrets.FIREBASE_V2_DEMO_APP_ID }}
53+
serviceCredentialsFileContent: ${{ secrets.STREAM_ANDROID_FIREBASE_CREDENTIALS_APP_CONTENT }}
54+
groups: stream-testers
55+
file: demo-app/build/outputs/apk/development/release/demo-app-development-release.apk

.github/workflows/app-distribute.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
gpg -d --passphrase "${{ env.PASSPHRASE }}" --batch .sign/keystore.properties.asc > .sign/keystore.properties
3030
echo "${{ env.ENV_PROPERTIES }}" > .env.properties
3131
- name: Assemble
32-
run: bash ./gradlew :demo-app:assembleRelease --stacktrace
32+
run: bash ./gradlew :demo-app:assembleDevelopmentRelease --stacktrace
3333
- name: Upload APK
3434
uses: actions/upload-artifact@v7
3535
with:
3636
name: demo-app-release
37-
path: demo-app/build/outputs/apk/demo-app/release/
37+
path: demo-app/build/outputs/apk/development/release/
3838
- name: Upload artifact to Firebase App Distribution
3939
uses: wzieba/Firebase-Distribution-Github-Action@bd494989dd4bec0343f78adee87fe66e48279ad6
4040
with:

0 commit comments

Comments
 (0)