-
-
Notifications
You must be signed in to change notification settings - Fork 85
143 lines (139 loc) · 5.91 KB
/
stable.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
name: Release CI
on: workflow_dispatch
jobs:
build_nomaps:
runs-on: ubuntu-latest
outputs:
versionCode: ${{ steps.versioncode.outputs.versionCode }}
versionName: ${{ steps.versionname.outputs.versionName }}
steps:
- uses: actions/checkout@v4
- name: Get versionCode
id: versioncode
run: echo "versionCode=$(grep 'versionCode' app/build.gradle.kts | awk '{ print $3 }')" >> $GITHUB_OUTPUT
- name: Get versionName
id: versionname
run: echo "versionName=$(grep 'versionName' app/build.gradle.kts | head -1 | awk -F\" '{ print $2 }')" >> $GITHUB_OUTPUT
- name: Strip internet permission
run: chmod +x ./strip_permission.sh && ./strip_permission.sh
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
cache: 'gradle'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'release_key.jks'
fileDir: 'app/'
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Build Release APK
run: ./gradlew assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: Gallery Release (No Maps)
path: app/build/outputs/apk/release/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-release.apk
build_maps:
runs-on: ubuntu-latest
outputs:
versionCode: ${{ steps.versioncode.outputs.versionCode }}
versionName: ${{ steps.versionname.outputs.versionName }}
steps:
- uses: actions/checkout@v4
- name: Get versionCode
id: versioncode
run: echo "versionCode=$(grep 'versionCode' app/build.gradle.kts | awk '{ print $3 }')" >> $GITHUB_OUTPUT
- name: Get versionName
id: versionname
run: echo "versionName=$(grep 'versionName' app/build.gradle.kts | head -1 | awk -F\" '{ print $2 }')" >> $GITHUB_OUTPUT
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
cache: 'gradle'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Load Maps Token
env:
MAPS_TOKEN: $
run: echo MAPS_TOKEN=\"$MAPS_TOKEN\" > ./api.properties
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'release_key.jks'
fileDir: 'app/'
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Build Release APK
run: ./gradlew assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: Gallery Release (Maps)
path: app/build/outputs/apk/release/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-release.apk
- name: Apply Google Play patch
id: gplay_patcher
run: git config --global user.email "[email protected]" &&
git config --global user.name "IacobIonut01" &&
git fetch https://github.com/IacobIonut01/Gallery.git main_play &&
git cherry-pick e63cd751baa1dc733222d5a3ce135cb7bc52868b
- name: Build Google Play Bundle
run: ./gradlew bundleGplay
env:
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.dot.gallery.gplay
releaseFiles: app/build/outputs/bundle/gplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-gplay.aab
track: production
releaseName: ${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }} Release
mappingFile: app/build/outputs/mapping/gplay/mapping.txt
debugSymbols: app/intermediates/merged_native_libs/gplay/mergeGplayNativeLibs/out/lib
- uses: actions/upload-artifact@v4
with:
name: Gallery Release (GPlay Bundle)
path: app/build/outputs/bundle/gplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-gplay.aab
release:
needs: [build_nomaps, build_maps]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: Gallery Release (No Maps)
- uses: actions/download-artifact@v4
with:
name: Gallery Release (Maps)
- name: Remove apk release suffix
run: find . -name "Gallery-*.apk" -exec bash -c 'mv "$1" "${1//-release/}"' _ {} \;
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }} Release
prerelease: false
tag_name: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}
files: |
./**/Gallery-*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}