3232 timeout-minutes : 60
3333 env :
3434 SHORT_SHA : ${{ needs.job-common.outputs.SHORT_SHA }}
35- outputs :
36- VERSION_NAME : ${{ steps.version.outputs.VERSION_NAME }}
37- VERSION_CODE : ${{ steps.version.outputs.VERSION_CODE }}
3835 steps :
3936 - name : checkout repo
4037 uses : actions/checkout@v4
@@ -46,25 +43,49 @@ jobs:
4643 with :
4744 distribution : ' temurin'
4845 java-version : ' 21'
49- cache : gradle
5046
51- - name : expose version
52- id : version
53- run : ./gradlew -q printVersion | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT
47+ - name : cache gradle dependencies
48+ uses : actions/cache@v4
49+ with :
50+ path : ~/.gradle/caches
51+ key : gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }}
52+ restore-keys : |
53+ gradle-${{ runner.os }}-
5454
55- - uses : gradle/actions/setup-gradle@v4
55+ - name : cache gradle wrapper
56+ uses : actions/cache@v3
5657 with :
57- cache-read-only : ${{ github.ref != 'refs/heads/main' }}
58- cache-write : true
58+ path : ~/.gradle/wrapper
59+ key : gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
60+
61+ - name : clean outputs directory
62+ run : rm -rf app/build/outputs/*
63+
64+ - name : make gradlew executable
65+ run : chmod +x ./gradlew
5966
60- - run : ./gradlew assembleDebug
67+ - name : assemble debug artifact
68+ run : ./gradlew assembleDebug
6169
62- - uses : actions/upload-artifact@v4
70+ - name : upload artifacts to outputs
71+ uses : actions/upload-artifact@v4
6372 with :
64- path : app/build/outputs/apk
65- retention-days : 1
73+ path : |
74+ app/build/outputs/apk
75+
76+ - name : expose version name
77+ id : version_name
78+ run : |
79+ VERSION_NAME=$(./gradlew printVersionName -q)
80+ echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
81+
82+ - name : expose version code
83+ id : version_code
84+ run : |
85+ VERSION_CODE=$(./gradlew printVersionCode -q)
86+ echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
6687
67- - name : expose debug apk path
88+ - name : expose apk path
6889 run : |
6990 echo "APK_PATH=$(find app/build/outputs/apk -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV
7091
0 commit comments