element-android-Github/.github/workflows/build.yml

76 lines
2.7 KiB
YAML
Raw Normal View History

2021-03-27 06:52:06 +08:00
name: APK Build
on:
2021-03-27 04:19:48 +08:00
pull_request: { }
push:
2021-05-07 00:25:34 +08:00
branches: [ main, develop ]
# Enrich gradle.properties for CI/CD
env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx2g
-Porg.gradle.parallel=false
jobs:
debug:
2021-05-19 23:38:32 +08:00
name: Build debug APKs (${{ matrix.target }})
runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('build-debug-develop-{0}', github.sha) || format('build-debug-{0}', github.ref) }}
cancel-in-progress: true
2021-05-07 00:25:34 +08:00
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
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
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 23:38:32 +08:00
name: vector-${{ matrix.target }}-debug
path: |
vector/build/outputs/apk/*/debug/*.apk
2021-05-19 23:38:32 +08:00
release:
name: Build unsigned GPlay APKs
runs-on: ubuntu-latest
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('build-release-develop-{0}', github.sha) || format('build-release-{0}', github.ref) }}
cancel-in-progress: true
2021-05-07 00:25:34 +08:00
if: github.ref == 'refs/heads/main'
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 23:38:32 +08:00
name: vector-gplay-release-unsigned
path: |
2021-05-19 23:38:32 +08:00
vector/build/outputs/apk/*/release/*.apk
# TODO: add exodus checks