2021-03-27 01:52:06 +03:00
|
|
|
name: APK Build
|
2021-03-25 14:26:26 +03:00
|
|
|
|
|
|
|
on:
|
2021-03-26 23:19:48 +03:00
|
|
|
pull_request: { }
|
2021-03-25 14:26:26 +03:00
|
|
|
push:
|
2021-05-06 19:25:34 +03:00
|
|
|
branches: [ main, develop ]
|
2021-03-25 14:26:26 +03:00
|
|
|
|
2021-09-08 14:03:51 +03:00
|
|
|
# Enrich gradle.properties for CI/CD
|
|
|
|
env:
|
2022-08-04 12:00:47 +03:00
|
|
|
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
2022-08-03 17:53:27 +03:00
|
|
|
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
|
2022-02-24 12:30:28 +03:00
|
|
|
|
2021-03-25 14:26:26 +03:00
|
|
|
jobs:
|
|
|
|
debug:
|
2021-05-19 18:38:32 +03:00
|
|
|
name: Build debug APKs (${{ matrix.target }})
|
2021-03-25 14:26:26 +03:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-06 19:25:34 +03:00
|
|
|
if: github.ref != 'refs/heads/main'
|
2021-03-25 14:26:26 +03:00
|
|
|
strategy:
|
2021-03-25 15:33:46 +03:00
|
|
|
fail-fast: false
|
2021-03-25 14:26:26 +03:00
|
|
|
matrix:
|
|
|
|
target: [ Gplay, Fdroid ]
|
2022-02-28 15:31:36 +03:00
|
|
|
# Allow all jobs on develop. Just one per PR.
|
2022-02-24 01:58:51 +03:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
|
|
|
|
cancel-in-progress: true
|
2021-03-25 14:26:26 +03:00
|
|
|
steps:
|
2022-03-08 02:05:24 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-03-22 02:03:30 +03:00
|
|
|
- uses: actions/cache@v3
|
2021-03-25 14:26:26 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Assemble ${{ matrix.target }} debug apk
|
2022-08-03 12:23:49 +03:00
|
|
|
run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES
|
2021-03-25 15:53:35 +03:00
|
|
|
- name: Upload ${{ matrix.target }} debug APKs
|
2022-04-12 02:08:54 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-25 14:26:26 +03:00
|
|
|
with:
|
2021-05-19 18:38:32 +03:00
|
|
|
name: vector-${{ matrix.target }}-debug
|
2021-03-25 14:26:26 +03:00
|
|
|
path: |
|
2022-08-03 14:06:06 +03:00
|
|
|
vector-app/build/outputs/apk/*/debug/*.apk
|
2021-03-25 14:26:26 +03:00
|
|
|
|
2021-05-19 18:38:32 +03:00
|
|
|
release:
|
|
|
|
name: Build unsigned GPlay APKs
|
2021-03-25 14:26:26 +03:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-14 18:01:38 +03:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref == 'refs/head/main' && format('build-release-apk-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('build-release-apk-develop-{0}', github.sha) || format('build-debug-{0}', github.ref) }}
|
|
|
|
cancel-in-progress: ${{ github.ref != 'refs/head/main' }}
|
2021-03-25 14:26:26 +03:00
|
|
|
steps:
|
2022-03-08 02:05:24 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-03-22 02:03:30 +03:00
|
|
|
- uses: actions/cache@v3
|
2021-03-25 14:26:26 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Assemble GPlay unsigned apk
|
2022-08-03 12:23:49 +03:00
|
|
|
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES
|
2021-03-25 15:53:35 +03:00
|
|
|
- name: Upload Gplay unsigned APKs
|
2022-04-12 02:08:54 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-25 14:26:26 +03:00
|
|
|
with:
|
2021-05-19 18:38:32 +03:00
|
|
|
name: vector-gplay-release-unsigned
|
2021-03-25 14:26:26 +03:00
|
|
|
path: |
|
2022-08-03 14:06:06 +03:00
|
|
|
vector-app/build/outputs/apk/*/release/*.apk
|
2021-03-25 14:26:26 +03:00
|
|
|
|
2022-06-14 18:01:38 +03:00
|
|
|
exodus:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: release
|
|
|
|
steps:
|
|
|
|
- name: Obtain apk from artifact
|
|
|
|
id: download
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: vector-gplay-release-unsigned
|
|
|
|
- name: Show apks in artifact
|
|
|
|
run: ls -R ${{steps.download.outputs.download-path}}
|
|
|
|
- name: Execute exodus-standalone
|
|
|
|
uses: docker://exodusprivacy/exodus-standalone:latest
|
|
|
|
with:
|
|
|
|
args: /github/workspace/gplay/release/vector-gplay-universal-release-unsigned.apk -j -o /github/workspace/exodus.json
|
|
|
|
- name: Upload exodus json report
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: exodus.json
|
|
|
|
path: |
|
2022-06-17 15:36:07 +03:00
|
|
|
exodus.json
|
2022-06-14 18:01:38 +03:00
|
|
|
- name: Check for trackers
|
|
|
|
run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }"
|