-
Notifications
You must be signed in to change notification settings - Fork 17
107 lines (93 loc) · 3.05 KB
/
deploy.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
name: Deploy
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
deploy:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Import GPG key for git-secret
run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch --yes
- name: Install git-secret
run: sudo apt-get install git-secret
- name: Decrypt secrets
run: git secret reveal -f
- name: Deploy production version
run: ./gradlew assembleRelease publishReleaseBundle --track production --release-status completed
- name: Build changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
with:
configurationJson: |
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"]
},
{
"title": "## 🐛 Fixes",
"labels": ["bug", "fix"]
},
{
"title": "## 🔧 Maintenance",
"labels": ["chore", "maintenance"]
},
{
"title": "## ⬆️ Dependencies",
"labels": ["dependencies"]
},
{
"title": "## 📚 Documentation",
"labels": ["documentation"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
}
],
"tag_resolver": {
"method": "sort"
}
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body: ${{steps.github_release.outputs.changelog}}
files: |
app/build/outputs/apk/**/*.apk
app/build/outputs/bundle/**/*.aab
- uses: actions/upload-artifact@v4
with:
name: Android artifacts
path: |
app/build/outputs/apk/**/*.apk
app/build/outputs/bundle/**/*.aab
increment-version:
timeout-minutes: 30
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v4
- name: Increment version code
run: sed -i 's/versionCode = [0-9]*/versionCode = '$(awk '/versionCode =/{print $3=$3+1}' app/build.gradle.kts)'/g' app/build.gradle.kts
- name: Increment version name
run: sed -i 's/versionName = .*/versionName = "'$(awk '/versionName =/{print substr($3,2,length($3)-2)+1}' app/build.gradle.kts)'"/g' app/build.gradle.kts
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[skip ci] Increment version code & name for next release'
branch: main