mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
name: Android CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build APK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Cancel previous runs
|
|
uses: styfle/cancel-workflow-action@0.5.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- name: Clone repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 11
|
|
|
|
- name: Build debug apk
|
|
uses: eskatos/gradle-command-action@v1
|
|
with:
|
|
arguments: :app:clean :app:build test
|
|
distributions-cache-enabled: true
|
|
dependencies-cache-enabled: true
|
|
configuration-cache-enabled: true
|
|
|
|
- name: Generate translation report
|
|
uses: eskatos/gradle-command-action@v1
|
|
with:
|
|
arguments: :app:checkTranslations
|
|
distributions-cache-enabled: true
|
|
dependencies-cache-enabled: true
|
|
configuration-cache-enabled: true
|
|
|
|
- name: Get branch name and short commit hash
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
|
|
- name: Rename APK
|
|
run: mv app/build/outputs/apk/debug/app-debug.apk ./AndroidIDE-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}.apk
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v2
|
|
if: ${{ !github.head_ref }}
|
|
with:
|
|
name: AndroidIDE-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}.apk
|
|
path: ./AndroidIDE-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}.apk
|
|
|
|
- name: Upload translation report
|
|
uses: actions/upload-artifact@v2
|
|
if: ${{ !github.head_ref }}
|
|
with:
|
|
name: translation-report
|
|
path: build/translation-reports/ |