Skip to content

Commit

Permalink
chore(infra): add github action for android build.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuasha420 committed May 21, 2022
1 parent 80504f3 commit 889395b
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Android Build

on:
push:
branches:
- master
paths:
- ".github/workflows/lint.yml"
- "**.js"
- "**.json"
- "**.ts"
- "**.tsx"
- "template/.eslint*"
- "template/.prettier*"
- "template/package.json"
- "template/tsconfig.json"
- "template/yarn.lock"
- "template/android/**"
pull_request:
branches:
- master
paths:
- ".github/workflows/lint.yml"
- "**.js"
- "**.json"
- "**.ts"
- "**.tsx"
- "template/.eslint*"
- "template/.prettier*"
- "template/package.json"
- "template/tsconfig.json"
- "template/yarn.lock"
- "template/android/**"
types:
- opened
- reopened
- synchronize

concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Android Build
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: template
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: "template/.nvmrc"
cache: "yarn"
cache-dependency-path: template/yarn.lock
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Install dependencies
run: yarn
- name: Android Release Build
run: cd android && ./gradlew assembleRelease --no-daemon
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: helloworld-app-release.apk
path: template/android/app/build/outputs/apk/release/app-release.apk
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ jobs:
run:
working-directory: template
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: "template/.nvmrc"
cache: "yarn"
Expand Down

0 comments on commit 889395b

Please sign in to comment.