1- name : Android CI
1+ name : Testing - build and release app
22
33on :
44 push :
55 branches :
66 - ' develop'
7- - ' release/*'
7+
8+ concurrency :
9+ group : ${{ github.workflow }}
10+ cancel-in-progress : true
811
912jobs :
1013 apk :
11- name : Generate APK
12- runs-on : ubuntu-18.04
13-
14+ name : Generate and upload APK to Discord
15+ runs-on : ubuntu-latest
1416 steps :
15- - uses : actions/checkout@v1
17+ - name : Checkout repository
18+ uses : actions/checkout@v3
1619
17- - name : Update Run Number in properties
18- uses : christian-draeger/write-properties@1.0.1
20+ - uses : actions/cache@v3
1921 with :
20- path : gradle.properties
21- property : RUN_NUMBER
22+ path : |
23+ ~/.gradle/caches
24+ ~/.gradle/wrapper
25+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
26+ restore-keys : |
27+ ${{ runner.os }}-gradle-
28+
29+ - uses : christian-draeger/write-properties@1.0.1
30+ with :
31+ path : app/version.properties
32+ property : VERSION_NUM
2233 value : ${{ github.run_number }}
2334
24- - name : set up JDK 1.8
25- uses : actions/setup-java@v1
35+ - name : set up JDK 17
36+ uses : actions/setup-java@v3
2637 with :
27- java-version : 1.8
38+ distribution : ' oracle'
39+ java-version : 17
40+ cache : ' gradle'
41+
42+ - name : Setup Android SDK
43+ uses : android-actions/setup-android@v2
2844
29- - name : Make .android folder
30- run : mkdir /home/runner/.android
45+ - name : set up Ruby for fastlane
46+ uses : ruby/setup-ruby@v1
47+ with :
48+ ruby-version : ' 3.3'
3149
3250 - name : Create debug keystore
3351 run : |
3452 echo "${{ secrets.CI_KEYSTORE }}" > debug.keystore.asc
3553 gpg -d --passphrase "${{ secrets.CI_KEYSTORE_DECRYPT }}" --batch debug.keystore.asc > /home/runner/.android/debug.keystore
36- - name : Build debug APK
37- run : bash ./gradlew assembleCi --stacktrace
54+
55+ - name : Install bundle
56+ run : bundle install
57+
58+ - name : Build apk with fastlane
59+ run : bundle exec fastlane testing
3860
3961 - name : set apk name env
4062 run : echo "APK_NAME=$(basename app/build/outputs/apk/ci/*.apk .apk)" >> $GITHUB_ENV
5173 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
5274 with :
5375 args : app/build/outputs/apk/ci/${{ env.APK_NAME }}.apk
76+
77+ - name : Report build status to Discord
78+ uses : sarisia/actions-status-discord@v1
79+ if : failure()
80+ with :
81+ title : " Build apk"
82+ webhook : ${{ secrets.DISCORD_BUILD_STATUS_WEBHOOK }}
0 commit comments