Skip to content

Commit 1678578

Browse files
committed
Simplify CI and updater APK selection
Streamline GitHub Actions: replace the matrix build with a single build job that assembles the Universal GMS release (assembleUniversalGmsRelease), remove the publish job, simplify cache keys and artifact naming (Echo-Universal), and adjust workflow triggers and Discord message text/labels. Updater changes: simplify APK selection logic to pick the first non-debug APK asset and extract its size and download URL (remove ABI/flavor detection and complex fallback logic).
1 parent 814304f commit 1678578

4 files changed

Lines changed: 19 additions & 132 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 11 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,14 @@ on:
55
branches: [main]
66
tags:
77
- 'v*'
8-
pull_request:
9-
branches: [main]
108
workflow_dispatch:
119

1210
env:
1311
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1412

1513
jobs:
16-
build-apks:
14+
build:
1715
runs-on: ubuntu-latest
18-
strategy:
19-
matrix:
20-
include:
21-
- abi: Universal
22-
abi_lower: universal
23-
variant: Foss
24-
variant_lower: foss
25-
- abi: Arm64
26-
abi_lower: arm64
27-
variant: Foss
28-
variant_lower: foss
29-
- abi: Armeabi
30-
abi_lower: armeabi
31-
variant: Foss
32-
variant_lower: foss
33-
- abi: X86_64
34-
abi_lower: x86_64
35-
variant: Foss
36-
variant_lower: foss
37-
- abi: Universal
38-
abi_lower: universal
39-
variant: Gms
40-
variant_lower: gms
41-
- abi: Arm64
42-
abi_lower: arm64
43-
variant: Gms
44-
variant_lower: gms
45-
- abi: Armeabi
46-
abi_lower: armeabi
47-
variant: Gms
48-
variant_lower: gms
49-
- abi: X86_64
50-
abi_lower: x86_64
51-
variant: Gms
52-
variant_lower: gms
5316

5417
steps:
5518
- name: Checkout Code
@@ -67,9 +30,9 @@ jobs:
6730
path: |
6831
~/.gradle/caches
6932
~/.gradle/wrapper
70-
key: ${{ runner.os }}-gradle-${{ matrix.variant }}-${{ matrix.abi }}-${{ hashFiles('**/*.gradle*') }}
33+
key: ${{ runner.os }}-gradle-gms-universal-${{ hashFiles('**/*.gradle*') }}
7134
restore-keys: |
72-
${{ runner.os }}-gradle-${{ matrix.variant }}-${{ matrix.abi }}-
35+
${{ runner.os }}-gradle-gms-universal-
7336
${{ runner.os }}-gradle-
7437
7538
- name: Create local.properties
@@ -92,70 +55,32 @@ jobs:
9255
mkdir -p app/keystore
9356
echo "$RELEASE_KEYSTORE_BASE64" | base64 --decode > app/keystore/release.keystore
9457
95-
- name: Build Debug APK (PR / Check)
96-
if: github.event_name == 'pull_request'
97-
run: ./gradlew assemble${{ matrix.abi }}${{ matrix.variant }}Debug
98-
9958
- name: Build and Sign Release APK (Push to main / Dispatch / Tag)
100-
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
10159
env:
10260
STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
10361
KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
10462
KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
105-
run: ./gradlew assemble${{ matrix.abi }}${{ matrix.variant }}Release
63+
run: ./gradlew assembleUniversalGmsRelease
10664

10765
- name: Rename and Organize APKs
10866
run: |
10967
VERSION_NAME=$(grep "versionName =" app/build.gradle.kts | head -n 1 | awk -F '"' '{print $2}')
11068
echo "App Version: $VERSION_NAME"
11169
mkdir -p app/build/outputs/apk/release-artifacts
11270
find app/build/outputs/apk/ -name "*.apk" ! -path "*/release-artifacts/*" | while read -r apk_path; do
113-
lower_path=$(echo "$apk_path" | tr '[:upper:]' '[:lower:]')
114-
115-
# 1. Determine build type
116-
case "$lower_path" in
117-
*debug*) build_type="debug" ;;
118-
*) build_type="release" ;;
119-
esac
120-
121-
# 2. Construct target name
122-
if [ "$build_type" = "debug" ]; then
123-
target_name="EchoMusic-v${VERSION_NAME}-${{ matrix.variant_lower }}-${{ matrix.abi_lower }}-debug.apk"
124-
else
125-
target_name="EchoMusic-v${VERSION_NAME}-${{ matrix.variant_lower }}-${{ matrix.abi_lower }}.apk"
126-
fi
127-
71+
target_name="Echo-${VERSION_NAME}-Universal.apk"
12872
cp "$apk_path" "app/build/outputs/apk/release-artifacts/$target_name"
12973
echo "Copied $apk_path -> app/build/outputs/apk/release-artifacts/$target_name"
13074
done
13175
13276
- name: Upload APK Artifact
13377
uses: actions/upload-artifact@v4
13478
with:
135-
name: EchoMusic-${{ matrix.variant_lower }}-${{ matrix.abi_lower }}-${{ github.event_name == 'pull_request' && 'debug' || 'release' }}
79+
name: Echo-Universal
13680
path: app/build/outputs/apk/release-artifacts/*.apk
13781

138-
publish:
139-
needs: build-apks
140-
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
141-
runs-on: ubuntu-latest
142-
steps:
143-
- name: Checkout Code
144-
uses: actions/checkout@v6
145-
146-
- name: Download Build Artifacts
147-
uses: actions/download-artifact@v4
148-
with:
149-
path: downloaded-artifacts
150-
151-
- name: Flatten Artifacts Directory
152-
run: |
153-
mkdir -p app/build/outputs/apk/release-artifacts
154-
find downloaded-artifacts/ -name "*.apk" -exec cp {} app/build/outputs/apk/release-artifacts/ \;
155-
echo "Flattened files list:"
156-
ls -R app/build/outputs/apk/release-artifacts
157-
15882
- name: Parse Release Info
83+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
15984
run: |
16085
# 1. Read first line and strip the "# " to get the Title
16186
TITLE=$(head -n 1 RELEASE_INFO.md | sed 's/^# //')
@@ -248,11 +173,11 @@ jobs:
248173
# Set title and download link parameters
249174
TARGET_TITLE="New Beta Build - v$VERSION_NAME"
250175
DOWNLOAD_LINK="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
251-
LINK_LABEL="Click here to download individual APK ZIPs from GitHub Actions Run Page"
176+
LINK_LABEL="Click here to download APK ZIP from GitHub Actions Run Page"
252177
253178
# Construct pings and warning messages
254-
PING_TEXT="<@&1498758915536584714> New Beta Build Available"
255-
WARNING_TEXT="Note: If you encounter an 'App not installed' error during installation, please uninstall the previous version before installing this update."
179+
PING_TEXT="<@&1498758915536584714> New Build Available"
180+
WARNING_TEXT="Note: If you're getting an update notification, there's no need to update since you're already using the latest version. Simply disable Automatic Update Check and Update Notifications in the update settings."
256181
257182
# Create Discord Embed JSON securely using jq
258183
jq -n \
@@ -269,7 +194,7 @@ jobs:
269194
description: ($desc + "\n\n" + $warn),
270195
color: 7303122,
271196
fields: [
272-
{ name: "Download APK Artifacts", value: ("[" + $label + "](" + $link + ")"), inline: false }
197+
{ name: "Download APK", value: ("[" + $label + "](" + $link + ")"), inline: false }
273198
],
274199
footer: { text: "Echo Music Automation System" }
275200
}]

RELEASE_INFO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Echo Music v5.1.6 - Beta Release
22

33
- Migrated default Listen Together server to Echo Music Server on Hugging Face (wss://iad1tya-echomusic.hf.space/ws). To modify or verify the URL, navigate to Listen Together > Settings > Server URL.
4-
- Enhanced in-app updater to dynamically detect device architecture (ABI) and flavor (FOSS/GMS) to download the correct update APK from GitHub Releases.
4+
- Configured single Universal GMS release APK outputs (Echo-5.1.6-Universal.apk) and streamlined update checker logic.

app/src/main/kotlin/com/music/vivi/echomusic/updater/echomusicupdater.kt

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -683,55 +683,17 @@ suspend fun checkForUpdate(
683683

684684
var apkSizeInMB = ""
685685
var apkDownloadUrl = ""
686-
687-
var targetApkAsset: JSONObject? = null
688-
var fallbackApkAsset: JSONObject? = null
689-
690-
val isGms = BuildConfig.FLAVOR.lowercase().contains("gms")
691-
val targetVariant = if (isGms) "gms" else "foss"
692-
693-
val supportedAbis = Build.SUPPORTED_ABIS ?: emptyArray()
694-
val targetAbi = when {
695-
supportedAbis.contains("arm64-v8a") -> "arm64"
696-
supportedAbis.contains("armeabi-v7a") || supportedAbis.contains("armeabi") -> "armeabi"
697-
supportedAbis.contains("x86_64") -> "x86_64"
698-
else -> "universal"
699-
}
700-
701686
for (j in 0 until assets.length()) {
702687
val asset = assets.getJSONObject(j)
703-
val assetName = asset.getString("name").lowercase()
704-
if (assetName.endsWith(".apk")) {
705-
if (assetName.contains(targetVariant)) {
706-
if (assetName.contains(targetAbi)) {
707-
targetApkAsset = asset
708-
break
709-
}
710-
if (assetName.contains("universal")) {
711-
fallbackApkAsset = asset
712-
}
713-
}
688+
val assetName = asset.getString("name")
689+
if (assetName.endsWith(".apk", ignoreCase = true) && !assetName.lowercase().contains("debug")) {
690+
val apkSizeInBytes = asset.getLong("size")
691+
apkSizeInMB = String.format("%.1f", apkSizeInBytes / (1024.0 * 1024.0))
692+
apkDownloadUrl = asset.getString("browser_download_url")
693+
break
714694
}
715695
}
716696

717-
val chosenAsset = targetApkAsset ?: fallbackApkAsset ?: run {
718-
var firstApk: JSONObject? = null
719-
for (j in 0 until assets.length()) {
720-
val asset = assets.getJSONObject(j)
721-
if (asset.getString("name").endsWith(".apk", ignoreCase = true)) {
722-
firstApk = asset
723-
break
724-
}
725-
}
726-
firstApk
727-
}
728-
729-
if (chosenAsset != null) {
730-
val apkSizeInBytes = chosenAsset.getLong("size")
731-
apkSizeInMB = String.format("%.1f", apkSizeInBytes / (1024.0 * 1024.0))
732-
apkDownloadUrl = chosenAsset.getString("browser_download_url")
733-
}
734-
735697
if (apkDownloadUrl.isNotEmpty()) {
736698
withContext(Dispatchers.Main) {
737699
onSuccess(displayTag, true, changelogList, apkSizeInMB, formattedReleaseDate, description, imageUrl, apkDownloadUrl)

app/src/main/res/values/vivi_strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@
900900
<string name="welcome_update_available">New version is available: %s</string>
901901
<string name="welcome_everything_ready">Everything is now up to date</string>
902902
<string name="commits_title">Commits</string>
903-
<string name="error_loading_commits">Failed to load commits becoz you didnt pay me ?</string>
903+
<string name="error_loading_commits">Failed to load commits</string>
904904
<string name="commits">Commits</string>
905905
<string name="view_commit_history">Browse recent changes on main branch</string>
906906
<string name="suggestions">Suggestions</string>

0 commit comments

Comments
 (0)