1
+ name : " Verify dependency chain"
2
+ on :
3
+ workflow_dispatch :
4
+ push :
5
+
6
+ jobs :
7
+ dependency-change-verification :
8
+ runs-on : ubuntu-latest
9
+ outputs :
10
+ changed : ${{ steps.changeDetection.outputs.should-run }}
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+ - name : Get changed files
14
+ id : changed-files
15
+ uses : tj-actions/changed-files@v44
16
+ - name : Verify build.gradle changed
17
+ id : changeDetection
18
+ env :
19
+ ALL_CHANGED_FILES : ${{ steps.changed-files.outputs.all_changed_files }}
20
+ run : |
21
+ GRADLE='build.gradle'
22
+ for file in ${ALL_CHANGED_FILES}; do
23
+ if [[ "$file" == *"$GRADLE" ]]; then
24
+ echo "$file was changed"
25
+ echo "should-run=true" >> $GITHUB_OUTPUT
26
+ fi
27
+ done
28
+
29
+ verify-dependencies :
30
+ runs-on : ubuntu-latest
31
+ needs : dependency-change-verification
32
+ if : needs.dependency-change-verification.outputs.changed == 'true'
33
+ steps :
34
+ - uses : actions/checkout@v4
35
+ - name : Read Go version from project
36
+ run : echo "GO_VERSION=$(grep -E "^de\.felixnuesse\.extract\.goVersion=" gradle.properties | cut -d'=' -f2)"
37
+ - name : Set up JDK 17
38
+ uses : actions/setup-java@v3
39
+ with :
40
+ java-version : ' 17'
41
+ distribution : ' temurin'
42
+ cache : gradle
43
+ - name : Set up Go from gradle.properties
44
+ uses : actions/setup-go@v4
45
+ with :
46
+ go-version : ' ${{env.GO_VERSION}}'
47
+ id : go
48
+ - name : Setup Android SDK/NDK
49
+ uses : android-actions/setup-android@v3
50
+ - name : Install NDK from gradle.properties
51
+ run : |
52
+ NDK_VERSION="$(grep -E "^de\.felixnuesse\.extract\.ndkVersion=" gradle.properties | cut -d'=' -f2)"
53
+ sdkmanager "ndk;${NDK_VERSION}"
54
+ - name : Build app
55
+ run : ./gradlew assembleOssDebug
56
+
57
+ - name : ' Check for non-FOSS libraries'
58
+ run : |
59
+ # prepare scanapk with apktool.
60
+ wget https://github.com/iBotPeaches/Apktool/releases/download/v$apktoolVersion/apktool_$apktoolVersion.jar
61
+ # Wrapper for apktool_*.jar
62
+ wget https://github.com/iBotPeaches/Apktool/raw/master/scripts/linux/apktool
63
+ # clone izzy's repo with the scan tools
64
+ git clone https://gitlab.com/IzzyOnDroid/repo.git
65
+ # create a directory for Apktool and move the apktool* files there
66
+ mkdir -p repo/lib/radar/tool
67
+ mv apktool* repo/lib/radar/tool
68
+ chmod u+x repo/lib/radar/tool/apktool
69
+ mv repo/lib/radar/tool/apktool_$apktoolVersion.jar repo/lib/radar/tool/apktool.jar
70
+ repo/bin/scanapk.php app/build/outputs/apk/oss/debug/roundsync_v*-oss-universal-debug.apk
71
+ env :
72
+ apktoolVersion : " 2.9.3"
73
+ - name : ' Get Commit Hash'
74
+ id : commit
75
+ uses : pr-mpt/actions-commit-hash@v1
0 commit comments