-
Notifications
You must be signed in to change notification settings - Fork 52
45 lines (38 loc) · 1.39 KB
/
android.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
name: Android CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Make keystore file
run: echo ${{ secrets.KEYSTORE }} | base64 -d > app/debug.keystore
- name: Make google service file
run: echo "${{ secrets.GOOGLE_SERVICE }}" | base64 -d > app/google-services.json
- name: Make debug google service file
run: echo "${{ secrets.DEBUG_GOOGLE_SERVICE }}" | base64 -d > app/src/debug/google-services.json
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew :app:assembleDebug
- name: Set file name
run: |
echo "FILE_NAME=app/build/outputs/apk/debug/Cosmostation-debug-$(date "+%y%m%d%H%M")-${GITHUB_SHA::6}-${GITHUB_REF#refs/heads/}.apk" >> $GITHUB_ENV
- name: Rename file
run: mv app/build/outputs/apk/debug/app-debug.apk ${{ env.FILE_NAME }}
- name: Upload to slack step
uses: adrey/slack-file-upload-action@master
continue-on-error: true
with:
token: ${{ secrets.SLACK_TOKEN }}
path: ${{ env.FILE_NAME }}
initial_comment: ${{ github.event.head_commit.message }}
channel: app-build