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