Merge pull request #130 from android/av/use-gradle-build-action

Update workflow config
pull/197/head
Don Turner 2 years ago committed by GitHub
commit 5bc50f4b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,16 +29,8 @@ jobs:
with: with:
java-version: 11 java-version: 11
- name: Generate cache key - name: Setup Gradle
run: ./scripts/checksum.sh checksum.txt uses: gradle/gradle-build-action@v2
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
- name: Check spotless - name: Check spotless
run: ./gradlew spotlessCheck --stacktrace run: ./gradlew spotlessCheck --stacktrace
@ -52,31 +44,18 @@ jobs:
- name: Run local tests - name: Run local tests
run: ./gradlew testDemoDebug testProdDebug --stacktrace run: ./gradlew testDemoDebug testProdDebug --stacktrace
- name: Upload Demo build outputs (APKs) - name: Upload build outputs (APKs)
uses: actions/upload-artifact@v3
with:
name: build-outputs-demo
path: app/demo/build/outputs
- name: Upload Prod build outputs (APKs)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: build-outputs-prod name: build-outputs
path: app/prod/build/outputs path: app/build/outputs
- name: Upload Demo build reports - name: Upload build reports
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: build-reports-demo name: build-reports
path: app/demo/build/reports path: app/build/reports
- name: Upload Prod build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports-prod
path: app/prod/build/reports
androidTest: androidTest:
needs: build needs: build
@ -98,16 +77,8 @@ jobs:
with: with:
java-version: 11 java-version: 11
- name: Generate cache key - name: Setup Gradle
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt uses: gradle/gradle-build-action@v2
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
- name: Run instrumentation tests - name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2

@ -25,8 +25,8 @@ jobs:
with: with:
java-version: 11 java-version: 11
- name: Build all projects - name: Build app
run: ./scripts/gradlew_recursive.sh assembleDebug run: ./gradlew :app:assembleDemoRelease
- name: Create Release - name: Create Release
id: create_release id: create_release
@ -39,72 +39,12 @@ jobs:
draft: true draft: true
prerelease: false prerelease: false
- name: Upload Crane - name: Upload app
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Crane/app/build/outputs/apk/debug/app-debug.apk asset_path: app/build/outputs/apk/demo/release/app-demo-release.apk
asset_name: crane-debug.apk asset_name: app-demo-release.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 asset_content_type: application/vnd.android.package-archive

@ -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
Loading…
Cancel
Save