-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.84 KB
/
main.yml
File metadata and controls
61 lines (52 loc) · 1.84 KB
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
name: Build APK
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.0
- name: Set up JDK
uses: actions/setup-java@v3.13.0
with:
java-version: '17'
distribution: 'temurin'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Create Google Services JSON File
env:
GOOGLE_SERVICES_JSON: ${{ secrets.TIB_KEYBOARD_GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON | base64 -di > app/google-services.json
- name: Build APK
run: ./gradlew build
- name: Upload APK (for PR and push events)
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
# Only create release for pushes to main branch (not PRs)
- name: Generate tag name
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
id: tag
run: |
echo "tag_name=v$(date +'%Y.%m.%d')-$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag_name }}
name: Release ${{ steps.tag.outputs.tag_name }}
body: |
Auto-generated release from commit ${{ github.sha }}
## Changes
- Built from latest main branch
- APK generated and attached
files: |
app/build/outputs/apk/debug/app-debug.apk
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}