-
Notifications
You must be signed in to change notification settings - Fork 15
153 lines (150 loc) · 5.14 KB
/
release.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Android CI
permissions:
contents: write
pull-requests: read
on:
push:
tags:
- '*'
jobs:
build-apk:
name: Build Signed APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: 'android_keystore.jks'
fileDir: '/home/runner/work/RecurringExpenseTracker/RecurringExpenseTracker/app/keystore/'
encodedString: ${{ secrets.KEYSTORE }}
- id: get_version
uses: battila7/get-version-action@v2
- name: Build APK
run: ./gradlew :app:assembleRelease -x test
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Verify Signature
run: $ANDROID_SDK_ROOT/build-tools/34.0.0/apksigner verify --print-certs app/build/outputs/apk/release/RecurringExpenseTracker_${{ steps.get_version.outputs.version-without-v }}.apk
- name: Upload APK
uses: actions/[email protected]
with:
name: apk
path: app/build/outputs/apk/release/RecurringExpenseTracker_${{ steps.get_version.outputs.version-without-v }}.apk
build-appbundle:
name: Build Signed AppBundle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: 'android_keystore.jks'
fileDir: '/home/runner/work/RecurringExpenseTracker/RecurringExpenseTracker/app/keystore/'
encodedString: ${{ secrets.KEYSTORE_PLAY_STORE }}
- name: Build AppBundle
run: ./gradlew :app:bundleRelease -x test
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_PLAY_STORE_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PLAY_STORE_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PLAY_STORE_PASSWORD }}
- name: Upload AppBundle
uses: actions/[email protected]
with:
name: appbundle
path: app/build/outputs/bundle/release/app-release.aab
- name: Create whatsnew
id: createWhatsNew
run: mkdir -p whatsnew && ls -v fastlane/metadata/android/en-US/changelogs/*.txt | tail -n 1 | xargs cat > whatsnew/whatsnew-en-US
- name: Upload whatsnew
uses: actions/[email protected]
with:
name: whatsnew
path: whatsnew/whatsnew-en-US
release:
name: Release
needs: [build-apk, build-appbundle]
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@v1
with:
name: apk
- name: Download aab from build
uses: actions/download-artifact@v1
with:
name: appbundle
- name: Download whatsnew from build
uses: actions/download-artifact@v1
with:
name: whatsnew
- id: get_version
uses: battila7/get-version-action@v2
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
with:
configurationJson: |
{
"categories": [
{
"title": "## 🚀 New Features",
"labels": [
"feature"
]
},
{
"title": "## 🐛 Bugs fixed",
"labels": [
"bug"
]
},
{
"title": "## 🧪 Updated Translations",
"labels": [
"translations"
]
},
{
"title": "## 💬 Minor Changes",
"labels": [
"cleanup / restructuring",
"dependencies"
]
}
],
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}"
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: mikepenz/action-gh-release@v1
with:
body: ${{steps.github_release.outputs.changelog}}
draft: true
files: apk/RecurringExpenseTracker_${{ steps.get_version.outputs.version-without-v }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Play Store
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }}
packageName: de.dbauer.expensetracker
releaseFiles: appbundle/app-release.aab
track: production
whatsNewDirectory: whatsnew/