try embedding dependency checking into github ci #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Verify dependency chain" | ||
on: | ||
workflow_dispatch: | ||
# push: | ||
# tags: | ||
# - '*' | ||
env: | ||
GO_VERSION: "$(grep -E "^de\.felixnuesse\.extract\.goVersion=" gradle.properties | cut -d'=' -f2)" | ||
jobs: | ||
build-android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Set up Go $GO_VERSION | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: $GO_VERSION | ||
id: go | ||
- name: Install NDK | ||
run: | | ||
NDK_VERSION="$(grep -E "^de\.felixnuesse\.extract\.ndkVersion=" gradle.properties | cut -d'=' -f2)" | ||
yes | sudo "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses | ||
sudo "${ANDROID_HOME}/tools/bin/sdkmanager" "ndk;${NDK_VERSION}" | ||
- name: Build app | ||
run: ./gradlew assembleOssRelease | ||
- 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*?(-beta)-oss-universal-debug.apk | ||
env: | ||
apktoolVersion: "2.9.3" | ||
- name: 'Get Commit Hash' | ||
id: commit | ||
uses: pr-mpt/actions-commit-hash@v1 |