Skip to content

Commit

Permalink
Add workflow to publish APK
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishbowler committed Jan 6, 2025
1 parent ff46de2 commit e660ab4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish

on:
workflow_dispatch:
push:
branches: [main]

jobs:
main:
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Build
run: ./gradlew --no-daemon assembleDebug

- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: setOrientation.apk
path: app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
retention-days: 1

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
# These credentials should only have write access to the bucket
credentials_json: ${{ secrets.GCP_MOBILEDEV_BUCKET_CREDENTIALS }}

- name: Set up Google Cloud CLI
uses: google-github-actions/setup-gcloud@v2
with:
version: ">= 484.0.0"
project_id: perf-dev-289002

- name: Upload apps to public Google Cloud Storage bucket
run: ./upload_to_gcs
12 changes: 12 additions & 0 deletions upload_to_gcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -eu

# Upload Android app
UPLOAD_PATH="gs://mobile.dev/cli_e2e"

cd app/build/outputs/apk/debug
cp app-debug.apk setOrientation.apk
cd -

gsutil cp app/build/outputs/apk/debug/setOrientation.apk "$UPLOAD_PATH/setOrientation.apk"
gsutil acl ch -r -u AllUsers:R "$UPLOAD_PATH/setOrientation.apk"

0 comments on commit e660ab4

Please sign in to comment.