-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (66 loc) · 2.54 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
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
78
79
name: ZePipeline
on:
push:
branches: [ main ]
pull_request:
branches:
- main
jobs:
release:
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: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
key: ${{ runner.os }}-dependency-cache
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and test everything
run: ./gradlew build testDebug
- name: Pull the release keystore
if: ${{ github.ref == 'refs/heads/main' }}
env:
KEYSTORE_URL: ${{ secrets.KEYSTORE_URL }}
run: curl $KEYSTORE_URL -o keystore/zeapp-keystore
- name: Sign the app with the new key
if: ${{ github.ref == 'refs/heads/main' }}
env:
KEYSTORE_FILE: ../keystore/zeapp-keystore
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
run: ./gradlew clean assembleRelease
- name: Store app version
if: ${{ github.ref == 'refs/heads/main' }}
id: versioning
run: echo ::set-output name=app_version::$(scripts/prop.sh version)
- name: Upload binaries to a release
if: ${{ github.ref == 'refs/heads/main' }}
uses: svenstaro/upload-release-action@v2
with:
release_name: ${{ format('Release v{0}', steps.versioning.outputs.app_version) }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: app/build/outputs/apk/release/app-release.apk
asset_name: ze-app-3.apk
tag: ${{ format('v{0}', steps.versioning.outputs.app_version) }}
overwrite: true
- name: Tweet about it 🐦
if: ${{ github.ref == 'refs/heads/main' }}
uses: ethomson/send-tweet-action@v1
with:
status: "${{format('Build {1} created app version {0} on https://github.com/gdg-berlin-android/ZeThree/releases/tag/v{0} #dcbln21', steps.versioning.outputs.app_version, github.run_id )}}"
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}