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