forked from newhinton/Round-Sync
-
Notifications
You must be signed in to change notification settings - Fork 1
194 lines (172 loc) · 6.29 KB
/
Copy pathbuild.yml
File metadata and controls
194 lines (172 loc) · 6.29 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Android CI Signed & Release
on:
workflow_dispatch:
inputs:
send_telegram:
description: 'Invia APK a Telegram'
type: boolean
default: false
push:
tags:
- 'v*'
jobs:
build-signed:
runs-on: ubuntu-latest
permissions:
contents: write
env:
APP_KEYSTORE_BASE64: ${{ secrets.APP_KEYSTORE_BASE64 }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
steps:
# -----------------------------
# CHECKOUT
# -----------------------------
- name: Checkout sources
uses: actions/checkout@v7
with:
fetch-depth: 0
# -----------------------------
# JDK
# -----------------------------
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
# -----------------------------
# GO
# -----------------------------
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
cache: true
# ---------------------------------------------------------
# CACHE Go modules (velocizza scaricamenti moduli)
# ---------------------------------------------------------
- name: Cache Go modules
uses: actions/cache@v6
with:
path: |
~/go/pkg/mod
key: go-mod-${{ hashFiles('rclone/go.sum') }}
restore-keys: |
go-mod-
# ---------------------------------------------------------
# CACHE Go build cache (velocizza compilazioni)
# ---------------------------------------------------------
- name: Cache Go build cache
uses: actions/cache@v6
with:
path: |
~/.cache/go-build
key: go-build-${{ hashFiles('rclone/go.sum') }}
restore-keys: |
go-build-
# -----------------------------
# ANDROID NDK
# -----------------------------
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r27d
link-to-sdk: true
# -----------------------------
# KEYSTORE
# -----------------------------
- name: Decode Keystore
if: ${{ env.APP_KEYSTORE_BASE64 != '' }}
run: |
mkdir -p app
echo "$APP_KEYSTORE_BASE64" | base64 --decode > app/release.keystore
# -----------------------------
# BUILD AND SIGN
# -----------------------------
- name: Build Signed Release APK (ALL SPLITS)
env:
CMD_RELEASE_KEYSTORE: release.keystore
CMD_RELEASE_KEYSTORE_PASSWORD: ${{ env.KEY_STORE_PASSWORD }}
CMD_RELEASE_KEY_ALIAS: ${{ env.KEY_ALIAS }}
CMD_RELEASE_KEY_PASSWORD: ${{ env.KEY_PASSWORD }}
run: |
echo "Eseguo build completa con TUTTE le architetture..."
./gradlew assembleOssRelease --stacktrace
###########################################################
# ARTIFACT SEPARATI
###########################################################
- name: Upload APK arm64-v8a
uses: actions/upload-artifact@v7
with:
name: roundsync-oss-arm64-v8a
path: app/build/outputs/apk/oss/release/*-oss-arm64-v8a-release.apk
retention-days: 90
if-no-files-found: warn
- name: Upload APK armeabi-v7a
uses: actions/upload-artifact@v7
with:
name: roundsync-oss-armeabi-v7a
path: app/build/outputs/apk/oss/release/*-oss-armeabi-v7a-release.apk
retention-days: 90
if-no-files-found: warn
- name: Upload APK x86
uses: actions/upload-artifact@v7
with:
name: roundsync-oss-x86
path: app/build/outputs/apk/oss/release/*-oss-x86-release.apk
retention-days: 90
if-no-files-found: warn
- name: Upload APK x86_64
uses: actions/upload-artifact@v7
with:
name: roundsync-oss-x86_64
path: app/build/outputs/apk/oss/release/*-oss-x86_64-release.apk
retention-days: 90
if-no-files-found: warn
- name: Upload APK universal
uses: actions/upload-artifact@v7
with:
name: roundsync-oss-universal
path: app/build/outputs/apk/oss/release/*-oss-universal-release.apk
retention-days: 90
if-no-files-found: warn
###########################################################
# RELEASE SU TAG
###########################################################
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
draft: false
prerelease: false
files: |
app/build/outputs/apk/oss/release/*-oss-arm64-v8a-release.apk
app/build/outputs/apk/oss/release/*-oss-armeabi-v7a-release.apk
app/build/outputs/apk/oss/release/*-oss-x86-release.apk
app/build/outputs/apk/oss/release/*-oss-x86_64-release.apk
app/build/outputs/apk/oss/release/*-oss-universal-release.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
###########################################################
# TELEGRAM (OPZIONALE)
###########################################################
- name: Send to Telegram
if: ${{ github.event.inputs.send_telegram == 'true' && success() }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: |
🚀 *Nuova Build Disponibile*
Repo: ${{ github.repository }}
Branch/Tag: ${{ github.ref_name }}
I file APK sono allegati qui sotto.
document: |
app/build/outputs/apk/oss/release/*-oss-arm64-v8a-release.apk
app/build/outputs/apk/oss/release/*-oss-armeabi-v7a-release.apk
app/build/outputs/apk/oss/release/*-oss-x86-release.apk
app/build/outputs/apk/oss/release/*-oss-x86_64-release.apk
app/build/outputs/apk/oss/release/*-oss-universal-release.apk