-
Notifications
You must be signed in to change notification settings - Fork 30
77 lines (62 loc) · 2.1 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }}
TMDB_API_URL: ${{ secrets.TMDB_API_URL }}
TRAKT_CLIENT_ID: ${{ secrets.TRAKT_CLIENT_ID }}
TRAKT_CLIENT_SECRET: ${{ secrets.TRAKT_CLIENT_SECRET }}
TRAKT_REDIRECT_URI: ${{ secrets.TRAKT_REDIRECT_URI }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 18
- name: Setup Gradle
uses: gradle/[email protected]
- name: Add App Secrets
run: |
echo -e "\TMDB_API_KEY=$TMDB_API_KEY" >> ./local.properties
echo -e "\TMDB_API_URL=$TMDB_API_URL" >> ./local.properties
echo -e "\TRAKT_CLIENT_ID=$TRAKT_CLIENT_ID" >> ./local.properties
echo -e "\TRAKT_CLIENT_SECRET=$TRAKT_CLIENT_SECRET" >> ./local.properties
echo -e "\TRAKT_REDIRECT_URI=$TRAKT_REDIRECT_URI" >> ./local.properties
- name: Check lint
run: ./gradlew lint
- name: Check spotless
run: ./gradlew spotlessCheck --init-script tooling/checks/spotless.gradle.kts --no-configuration-cache
- name: Build with gradle
run: ./gradlew assemble
- name: Run local tests
run: ./gradlew testDemoDebug
- name: Build
run: ./gradlew assembleDemoDebug
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: android/app/build/outputs/apk/demo/debug/app-demo-debug.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v3
with:
name: build-outputs
path: android/app/build/outputs