SchildiChat-android/.github/workflows/build.yml

71 lines
2.2 KiB
YAML
Raw Normal View History

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