-
Notifications
You must be signed in to change notification settings - Fork 29
48 lines (42 loc) · 1.24 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Build release
run: ./gradlew assembleRelease
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- uses: actions/upload-artifact@v2
with:
name: app
path: app/build/outputs/apk/release/app-*.apk
if-no-files-found: error
deploy:
name: Deploy to GitHub Releases
needs: build
runs-on: ubuntu-18.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Get the APK
id: get_apk
uses: actions/download-artifact@v2
with:
name: app
- name: Publish the APK to GitHub Releases
uses: svenstaro/upload-release-action@v2
with:
prerelease: true
asset_name: pinning-demo.apk
file: ${{ steps.get_apk.outputs.download-path }}/app-release.apk
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}