2021-03-26 23:52:06 +01:00
|
|
|
name: APK Build
|
2021-03-25 12:26:26 +01:00
|
|
|
|
|
|
|
on:
|
2021-03-26 21:19:48 +01:00
|
|
|
pull_request: { }
|
2021-03-25 12:26:26 +01:00
|
|
|
push:
|
2021-05-06 18:25:34 +02:00
|
|
|
branches: [ main, develop ]
|
2021-03-25 12:26:26 +01:00
|
|
|
|
2021-09-08 13:03:51 +02:00
|
|
|
# Enrich gradle.properties for CI/CD
|
|
|
|
env:
|
|
|
|
CI_GRADLE_ARG_PROPERTIES: >
|
|
|
|
-Porg.gradle.jvmargs=-Xmx2g
|
|
|
|
-Porg.gradle.parallel=false
|
|
|
|
|
2021-03-25 12:26:26 +01:00
|
|
|
jobs:
|
|
|
|
debug:
|
2021-05-19 17:38:32 +02:00
|
|
|
name: Build debug APKs (${{ matrix.target }})
|
2021-03-25 12:26:26 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-06 18:25:34 +02:00
|
|
|
if: github.ref != 'refs/heads/main'
|
2021-03-25 12:26:26 +01:00
|
|
|
strategy:
|
2021-03-25 13:33:46 +01:00
|
|
|
fail-fast: false
|
2021-03-25 12:26:26 +01:00
|
|
|
matrix:
|
|
|
|
target: [ Gplay, Fdroid ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
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
|
2021-09-08 13:03:51 +02:00
|
|
|
run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES --stacktrace
|
2021-03-25 13:53:35 +01:00
|
|
|
- name: Upload ${{ matrix.target }} debug APKs
|
2021-03-25 12:26:26 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-05-19 17:38:32 +02:00
|
|
|
name: vector-${{ matrix.target }}-debug
|
2021-03-25 12:26:26 +01:00
|
|
|
path: |
|
|
|
|
vector/build/outputs/apk/*/debug/*.apk
|
|
|
|
|
2021-05-19 17:38:32 +02:00
|
|
|
release:
|
|
|
|
name: Build unsigned GPlay APKs
|
2021-03-25 12:26:26 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-06 18:25:34 +02:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2021-03-25 12:26:26 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
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
|
2021-09-08 13:03:51 +02:00
|
|
|
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace
|
2021-03-25 13:53:35 +01:00
|
|
|
- name: Upload Gplay unsigned APKs
|
2021-03-25 12:26:26 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-05-19 17:38:32 +02:00
|
|
|
name: vector-gplay-release-unsigned
|
2021-03-25 12:26:26 +01:00
|
|
|
path: |
|
2021-05-19 17:38:32 +02:00
|
|
|
vector/build/outputs/apk/*/release/*.apk
|
2021-03-25 12:26:26 +01:00
|
|
|
|
|
|
|
# TODO: add exodus checks
|