1616 - ' NOTICE'
1717 - ' .gitignore'
1818
19+ permissions :
20+ contents : read
21+ pull-requests : write
22+
1923jobs :
2024 build :
2125 runs-on : ubuntu-latest
3034 submodules : recursive
3135
3236 - name : set up JDK 17
33- uses : actions/setup-java@v3.12.0
37+ uses : actions/setup-java@v4
3438 with :
3539 java-version : ' 17'
3640 distribution : ' adopt'
5458 git fetch origin main --depth 1
5559 ./gradlew spotlessCheck
5660
57- - name : Build with Gradle
61+ - name : Build and test with Gradle
5862 run : ./gradlew assembleRelease livekit-android-test:testRelease
5963
64+ - name : Upload AAR
65+ uses : actions/upload-artifact@v6
66+ with :
67+ name : livekit-android-sdk-release.aar
68+ path : client-sdk-android/livekit-android-sdk/build/outputs/aar/livekit-android-sdk-release.aar
69+
6070 # TODO: Figure out appropriate place to run this. Takes ~3 mins, so pretty slow.
6171# # generates coverage-report.md and publishes as checkrun
6272# - name: JaCoCo Code Coverage Report
@@ -174,6 +184,20 @@ jobs:
174184 if : github.event_name == 'push' && contains(steps.version_name.outputs.version_name,'SNAPSHOT')
175185 run : ./gradlew publishReleasePublicationToMavenRepository
176186
187+ # Setting up diffuse artifacts
188+ - name : Setup cache for base source file for diffuse
189+ if : github.event_name == 'push'
190+ uses : actions/cache@v4
191+ with :
192+ path : diffuse-source-file
193+ key : diffuse-${{ github.sha }}
194+
195+ # Copy your build artifact under `diffuse-source-file` name which will be saved in cache
196+ - name : Copy diffuse source file
197+ run : cp ./livekit-android-sdk/build/outputs/aar/livekit-android-sdk-release.aar diffuse-source-file
198+ if : github.event_name == 'push'
199+ shell : bash
200+
177201 - name : Repository Dispatch
178202 if : github.event_name == 'push'
179203 uses : peter-evans/repository-dispatch@v2
@@ -182,3 +206,52 @@ jobs:
182206 repository : livekit/e2e-android
183207 event-type : client-sdk-android-push
184208 client-payload : ' {"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
209+
210+ diffuse :
211+ runs-on : ubuntu-latest
212+ if : ${{ github.event_name == 'pull_request' }}
213+ name : Diffuse checker
214+ needs : build
215+ steps :
216+ - uses : actions/setup-java@v4
217+ with :
218+ java-version : ' 17'
219+ distribution : ' adopt'
220+
221+ # Diffuse checking for pull requests
222+ - uses : actions/cache@v4
223+ name : Download base source file for diffuse
224+ with :
225+ path : diffuse-source-file
226+ key : diffuse-${{ github.event.pull_request.base.sha }}
227+
228+ - id : diffuse
229+ uses : usefulness/diffuse-action@v1
230+ with :
231+ old-file-path : diffuse-source-file
232+ new-file-path : client-sdk-android/livekit-android-sdk/build/outputs/aar/livekit-android-sdk-release.aar
233+
234+ # Consuming diffuse action output
235+
236+ - uses : peter-evans/find-comment@v4
237+ id : find_comment
238+ with :
239+ issue-number : ${{ github.event.pull_request.number }}
240+ body-includes : Diffuse output
241+
242+ - uses : peter-evans/create-or-update-comment@v5
243+ if : ${{ steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null }}
244+ with :
245+ body : |
246+ Diffuse output:
247+
248+ ${{ steps.diffuse.outputs.diff-gh-comment }}
249+ edit-mode : replace
250+ comment-id : ${{ steps.find_comment.outputs.comment-id }}
251+ issue-number : ${{ github.event.pull_request.number }}
252+ token : ${{ secrets.GITHUB_TOKEN }}
253+
254+ - uses : actions/upload-artifact@v6
255+ with :
256+ name : diffuse-output
257+ path : ${{ steps.diffuse.outputs.diff-file }}
0 commit comments