-
-
Notifications
You must be signed in to change notification settings - Fork 90
60 lines (58 loc) · 2 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
name: Android CI
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Grant execute permission to scripts
run: chmod +x gradlew .github/decrypt_secrets.sh
- name: Decrypt GPG secrets
if: ${{ !startsWith(github.ref, 'refs/pull') }}
run: .github/decrypt_secrets.sh
env:
SECRETS_GPG_PASS: ${{ secrets.SECRETS_GPG_PASS }}
- name: Build with Gradle
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: ./gradlew connectedCheck --no-daemon
- name: Publish with Gradle
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: ./gradlew assembleRelease publishApps --no-daemon
env:
KEYSTORE_STORE_PASS: ${{ secrets.KEYSTORE_STORE_PASS }}
KEYSTORE_KEY_ALIAS: gianlu
KEYSTORE_KEY_PASS: ${{ secrets.KEYSTORE_KEY_PASS }}
- name: Create release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: app/src/main/play/release-notes/en-GB/production.txt
draft: true
prerelease: false
- name: Upload APK file
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/foss/release/app-foss-release.apk
asset_name: app-foss-release.apk
asset_content_type: application/vnd.android.package-archive