From d6e6793e92050d9c81dd8a6d6ea80d59af65193c Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Fri, 13 May 2022 15:16:14 -0700 Subject: [PATCH 1/4] Update release YML Change-Id: If5d4764f9361bf0141f0f7937114c7945835b3a8 --- .github/workflows/Release.yml | 68 +++-------------------------------- 1 file changed, 4 insertions(+), 64 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index ccaa3dd86..086eb1c25 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -26,7 +26,7 @@ jobs: java-version: 11 - name: Build all projects - run: ./scripts/gradlew_recursive.sh assembleDebug + run: ./gradlew assembleDebug - name: Create Release id: create_release @@ -39,72 +39,12 @@ jobs: draft: true prerelease: false - - name: Upload Crane + - name: Upload app uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Crane/app/build/outputs/apk/debug/app-debug.apk - asset_name: crane-debug.apk + asset_path: app/build/outputs/apk/debug/app-debug.apk + asset_name: app-debug.apk asset_content_type: application/vnd.android.package-archive - - - name: Upload Owl - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Owl/app/build/outputs/apk/debug/app-debug.apk - asset_name: owl-debug.apk - asset_content_type: application/vnd.android.package-archive - - - name: Upload Jetcaster - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Jetcaster/app/build/outputs/apk/debug/app-debug.apk - asset_name: jetcaster-debug.apk - asset_content_type: application/vnd.android.package-archive - - - name: Upload Jetchat - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Jetchat/app/build/outputs/apk/debug/app-debug.apk - asset_name: jetchat-debug.apk - asset_content_type: application/vnd.android.package-archive - - - name: Upload Jetnews - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: JetNews/app/build/outputs/apk/debug/app-debug.apk - asset_name: jetnews-debug.apk - asset_content_type: application/vnd.android.package-archive - - - name: Upload Jetsnack - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Jetsnack/app/build/outputs/apk/debug/app-debug.apk - asset_name: jetsnack-debug.apk - asset_content_type: application/vnd.android.package-archive - - - name: Upload Jetsurvey - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Jetsurvey/app/build/outputs/apk/debug/app-debug.apk - asset_name: jetsurvey-debug.apk - asset_content_type: application/vnd.android.package-archive From 2305b87d170eaf69d1457b7d7d3e7e8650e45ce8 Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Fri, 13 May 2022 15:39:16 -0700 Subject: [PATCH 2/4] Simplify Gradle caching setup Using gradle/gradle-build-action which takes care of caching, we can remove the custom checksum calculation and files. Change-Id: I190e4f911f6fa70199fd75a7335df12983157516 --- .github/workflows/Build.yaml | 24 ++++------------------ scripts/checksum.sh | 39 ------------------------------------ 2 files changed, 4 insertions(+), 59 deletions(-) delete mode 100755 scripts/checksum.sh diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index d1590932c..51938bb74 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -29,16 +29,8 @@ jobs: with: java-version: 11 - - name: Generate cache key - run: ./scripts/checksum.sh checksum.txt - - - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: Check spotless run: ./gradlew spotlessCheck --stacktrace @@ -98,16 +90,8 @@ jobs: with: java-version: 11 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: Run instrumentation tests uses: reactivecircus/android-emulator-runner@v2 diff --git a/scripts/checksum.sh b/scripts/checksum.sh deleted file mode 100755 index 438f9e90e..000000000 --- a/scripts/checksum.sh +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright 2022 Google, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#!/bin/bash -RESULT_FILE=$1 - -if [ -f $RESULT_FILE ]; then - rm $RESULT_FILE -fi -touch $RESULT_FILE - -checksum_file() { - echo $(openssl md5 $1 | awk '{print $2}') -} - -FILES=() -while read -r -d ''; do - FILES+=("$REPLY") -done < <(find . -type f \( -name "build.gradle*" -o -name "gradle-wrapper.properties" -o -name "robolectric.properties" \) -print0) - -# Loop through files and append MD5 to result file -for FILE in ${FILES[@]}; do - echo $(checksum_file $FILE) >> $RESULT_FILE -done -# Now sort the file so that it is idempotent -sort $RESULT_FILE -o $RESULT_FILE From fab95a24987e0c49175f553f71caedab7501f998 Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Thu, 9 Jun 2022 12:05:51 -0700 Subject: [PATCH 3/4] Update workflows for flavor configuration Change-Id: I0e9fe55b2e3767223bea44a6ebd3c9e2e5ee2be0 --- .github/workflows/Build.yaml | 25 ++++++------------------- .github/workflows/Release.yml | 4 ++-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 51938bb74..f0813b76d 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -44,31 +44,18 @@ jobs: - name: Run local tests run: ./gradlew testDemoDebug testProdDebug --stacktrace - - name: Upload Demo build outputs (APKs) + - name: Upload build outputs (APKs) uses: actions/upload-artifact@v2 with: - name: build-outputs-demo - path: app/demo/build/outputs + name: build-outputs + path: app/build/outputs - - name: Upload Prod build outputs (APKs) - uses: actions/upload-artifact@v2 - with: - name: build-outputs-prod - path: app/prod/build/outputs - - - name: Upload Demo build reports - if: always() - uses: actions/upload-artifact@v2 - with: - name: build-reports-demo - path: app/demo/build/reports - - - name: Upload Prod build reports + - name: Upload build reports if: always() uses: actions/upload-artifact@v2 with: - name: build-reports-prod - path: app/prod/build/reports + name: build-reports + path: app/build/reports androidTest: needs: build diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 086eb1c25..5a658ae53 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -45,6 +45,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: app/build/outputs/apk/debug/app-debug.apk - asset_name: app-debug.apk + asset_path: app/build/outputs/apk/demo/debug/app-demo-debug.apk + asset_name: app-demo-debug.apk asset_content_type: application/vnd.android.package-archive From de506119a643004e289d9f279f39239309b3efea Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Mon, 13 Jun 2022 17:04:23 -0700 Subject: [PATCH 4/4] Release release APK Change-Id: Ic54b843587281a29b58683f9ae9de02dbce13edc --- .github/workflows/Release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 5a658ae53..814d927bd 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -25,8 +25,8 @@ jobs: with: java-version: 11 - - name: Build all projects - run: ./gradlew assembleDebug + - name: Build app + run: ./gradlew :app:assembleDemoRelease - name: Create Release id: create_release @@ -45,6 +45,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: app/build/outputs/apk/demo/debug/app-demo-debug.apk - asset_name: app-demo-debug.apk + asset_path: app/build/outputs/apk/demo/release/app-demo-release.apk + asset_name: app-demo-release.apk asset_content_type: application/vnd.android.package-archive