-
Notifications
You must be signed in to change notification settings - Fork 85
89 lines (71 loc) · 3.02 KB
/
android-nightly.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
80
81
82
83
84
85
86
87
88
89
name: Android nightly build
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: 'master'
- name: Replace applicationId and name
run: |
sed -i 's/applicationId "xyz.zedler.patrick.grocy"/applicationId "xyz.zedler.patrick.grocy.nightly"/' app/build.gradle
sed -i 's|<string name="app_name" translatable="false">Grocy</string>|<string name="app_name" translatable="false">Grocy Nightly</string>|g' app/src/main/res/values/strings.xml
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Rename artifacts
run: |
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/Grocy-Android-master-$(date +'%Y%m%d').apk
cp app/src/main/res/raw/changelog.txt app/build/outputs/apk/debug/Grocy-Android-master-$(date +'%Y%m%d')-changelog.txt
- name: Upload artifacts
uses: pyTooling/Actions/releaser@r0
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
rm: true
tag: nightly
files: |
app/build/outputs/apk/debug/*.apk
app/build/outputs/apk/debug/*.txt
- name: Replace applicationId to default for checkout without git commit
run: |
sed -i 's/applicationId "xyz.zedler.patrick.grocy.nightly"/applicationId "xyz.zedler.patrick.grocy"/' app/build.gradle
sed -i 's|<string name="app_name" translatable="false">Grocy</string>|<string name="app_name" translatable="false">Grocy Nightly</string>|g' app/src/main/res/values/strings.xml
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: 'feature/mlkit_scanner'
- name: Replace applicationId and name
run: |
sed -i 's/applicationId "xyz.zedler.patrick.grocy"/applicationId "xyz.zedler.patrick.grocy.nightly"/' app/build.gradle
sed -i 's%@string/app_name%Grocy Nightly%' app/src/main/AndroidManifest.xml
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Rename artifacts
run: |
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/Grocy-Android-mlkit-$(date +'%Y%m%d').apk
cp app/src/main/res/raw/changelog.txt app/build/outputs/apk/debug/Grocy-Android-mlkit-$(date +'%Y%m%d')-changelog.txt
- name: Upload artifacts
uses: pyTooling/Actions/releaser@r0
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
rm: false
tag: nightly
files: |
app/build/outputs/apk/debug/*.apk
app/build/outputs/apk/debug/*.txt