Skip to content

Commit

Permalink
ci: store each APK in a separated archive (#890)
Browse files Browse the repository at this point in the history
* Archive APKs separately

* Update docker/setup-buildx-action@v2 to v3

* Update docker/login-action@v2 to v3

* Update docker/metadata-action@v4 to v5

* Update docker/build-push-action@v4 to v5

* Update actions/cache@v3 to v4

* add var CHANGES_NOT_SENT_FOR_REVIEW
  • Loading branch information
anhappdev authored Jun 11, 2024
1 parent 9543977 commit d65e4a7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 24 deletions.
57 changes: 46 additions & 11 deletions .github/workflows/android-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker image
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/mlcommons/mobile_app_open-android
flavor: latest=true
tags: type=raw,value=${{ github.run_number }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: flutter/android/docker
file: flutter/android/docker/Dockerfile
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
mkdir -p mobile_back_qti/${QTI_LIB} && \
mv /tmp/${QTI_LIB}/* mobile_back_qti/${QTI_LIB}/
- name: Cache bazel
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/bazel_cache
key: ${{ runner.os }}-bazel_cache-${{ hashFiles('**/BUILD', '**/WORKSPACE') }}
Expand Down Expand Up @@ -181,11 +181,46 @@ jobs:
make flutter/android/release
gsutil cp flutter/build/app/outputs/bundle/release/app-release.aab $GCLOUD_BUCKET_PATH/app-release.aab
gsutil cp flutter/build/app/outputs/flutter-apk/app-release.apk $GCLOUD_BUCKET_PATH/app-release.apk
- name: Archive Android APKs
uses: actions/upload-artifact@v3
- name: Archive APK with TFLite backend
uses: actions/upload-artifact@v4
with:
name: android-apks-${{ github.run_number }}
path: output/android-apks/*.apk
name: android-apk-tflite-${{ github.run_number }}
path: output/android-apks/*-t-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error
- name: Archive APK with Pixel backend
uses: actions/upload-artifact@v4
with:
name: android-apk-pixel-${{ github.run_number }}
path: output/android-apks/*-g-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error
- name: Archive APK with QTI backend
uses: actions/upload-artifact@v4
with:
name: android-apk-qti-${{ github.run_number }}
path: output/android-apks/*-q-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error
- name: Archive APK with MediaTek backend
uses: actions/upload-artifact@v4
with:
name: android-apk-mtk-${{ github.run_number }}
path: output/android-apks/*-m-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error
- name: Archive APK with Samsung backend
uses: actions/upload-artifact@v4
with:
name: android-apk-samsung-${{ github.run_number }}
path: output/android-apks/*-s-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error
- name: Archive APK with unified backend
uses: actions/upload-artifact@v4
with:
name: android-apk-unified-${{ github.run_number }}
path: output/android-apks/*-qsmgt-${{ github.run_number }}.apk
retention-days: 28
if-no-files-found: error

Expand Down Expand Up @@ -294,7 +329,7 @@ jobs:
- build-android-apk
- test-android-apk-tflite
runs-on: ubuntu-22.04
# if: github.ref == 'refs/heads/master'
# if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Set up authentication for Google Cloud SDK
Expand All @@ -317,4 +352,4 @@ jobs:
serviceAccountJsonPlainText: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_MOBILE_APP_BUILD }}
track: internal # "alpha", "beta", "internal" or "production"
status: draft
changesNotSentForReview: true
changesNotSentForReview: ${{ vars.CHANGES_NOT_SENT_FOR_REVIEW }}
12 changes: 6 additions & 6 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ jobs:
echo AFTER:
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for base image
id: meta-base
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/mlcommons/mobile_app_open-base
flavor: latest=true
tags: type=raw,value=${{ github.run_number }}
- name: Build and push base image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: flutter/android/docker
file: flutter/android/docker/Dockerfile
Expand All @@ -65,13 +65,13 @@ jobs:
cache-to: type=gha,mode=max
- name: Extract metadata for scanner image
id: meta-scanner
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/mlcommons/mobile_app_open-scanner
flavor: latest=true
tags: type=raw,value=${{ github.run_number }}
- name: Build and push scanner image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: tools/scanner
file: tools/scanner/Dockerfile
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/format-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/mlcommons/mobile_app_open-formatter
flavor: latest=true
tags: type=raw,value=${{ github.run_number }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: tools/formatter
file: tools/formatter/Dockerfile
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Cache Flutter packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /home/mlperf/.pub-cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Cache CocoaPods
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/flutter/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-
- name: Cache bazel
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/bazel_cache
key: ${{ runner.os }}-bazel_cache-${{ hashFiles('**/BUILD', '**/WORKSPACE') }}
Expand Down

0 comments on commit d65e4a7

Please sign in to comment.