-
-
Notifications
You must be signed in to change notification settings - Fork 206
145 lines (123 loc) · 4.07 KB
/
release-ci.yml
File metadata and controls
145 lines (123 loc) · 4.07 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
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
name: Release CI
permissions:
contents: read
packages: read
on:
pull_request:
workflow_dispatch:
inputs:
send_telegram:
description: "Release to Telegram"
required: true
default: false
type: boolean
send_github:
description: "Release on GitHub"
required: true
default: false
type: boolean
send_playstore:
description: "Release on Play Store"
required: true
default: false
type: boolean
playstore_track:
type: choice
default: production
description: Google Play Store Track
options:
- production
- beta
- alpha
- qa
jobs:
# Build step for both official & spoofed flavors
build-release:
runs-on: ubuntu-latest
name: Build Matrix
strategy:
fail-fast: false
matrix:
flavor: [official, spoofed]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build APK
id: build-apk
uses: ./.github/actions/build-apk
with:
username: ${{ secrets.ACTOR }}
token: ${{ secrets.GITHUB_TOKEN }}
flavor: ${{ matrix.flavor }}
buildType: "release"
keyStore: ${{ secrets.KEY_STORE }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyAlias: ${{ secrets.KEY_ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
# Release to Telegram
release-telegram:
if: github.event.inputs.send_telegram == 'true'
name: Release to Telegram
needs: build-release
uses: ./.github/workflows/telegram.yml
secrets: inherit
# Release to GitHub
release-github:
if: github.event.inputs.send_github == 'true'
name: Release to GitHub
needs: build-release
uses: ./.github/workflows/github.yml
secrets: inherit
# Release to Play Store
release-playstore:
if: github.event.inputs.send_playstore == 'true'
name: Release to Play Store
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up signing key
run: |
if [ -n "${{ secrets.KEY_STORE }}" ]; then
echo keyStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> signing.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> signing.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> signing.properties
echo keyStore='${{ github.workspace }}/key.jks' >> signing.properties
echo ${{ secrets.KEY_STORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Set up kez for private packages
shell: bash
run: |
if [ -n "${{ secrets.ACTOR }}" ]; then
echo gpr.user='${{ secrets.ACTOR }}' >> gradle.properties
echo gpr.key='${{ secrets.GITHUB_TOKEN }}' >> gradle.properties
fi
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true
- name: Bundle with Gradle
run: chmod +x ./gradlew && ./gradlew bundleOfficialPlaystore
- name: Find AAB
id: find_aab
run: |
AAB_PATH=$(find app/build/outputs/bundle/officialPlaystore -name "*.aab" -print -quit)
echo "AAB_PATH=$AAB_PATH" >> $GITHUB_OUTPUT
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.dergoogler.mmrl
releaseFiles: ${{ steps.find_aab.outputs.AAB_PATH }}
track: ${{ github.event.inputs.playstore_track }}
status: completed
inAppUpdatePriority: 5