Skip to content

Commit 76a0c3f

Browse files
committed
ci: attach a version.txt asset to every release
F-Droid's update checker cannot parse the computed versionCode out of gradle, so each release now carries the literals in a tiny asset that releases/latest serves at a stable URL.
1 parent b50f5df commit 76a0c3f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ jobs:
125125
NAME="spoo-${VERSION}.apk"
126126
cp app/build/outputs/apk/release/app-release.apk "$NAME"
127127
sha256sum "$NAME" > "${NAME}.sha256"
128+
# F-Droid's update checker reads this from releases/latest; it
129+
# cannot parse the computed versionCode out of gradle.
130+
BARE="${VERSION#v}"
131+
IFS=. read -r MA MI PA <<< "$BARE"
132+
printf 'versionName=%s
133+
versionCode=%s
134+
' "$BARE" "$((MA*10000+MI*100+PA))" > version.txt
128135
# Stable-named twin: releases/latest/download/spoo.apk is the
129136
# public download URL, and it only resolves if every release
130137
# carries an asset with this exact name.
@@ -143,7 +150,8 @@ jobs:
143150
"${{ steps.package.outputs.name }}" \
144151
"${{ steps.package.outputs.name }}.sha256" \
145152
spoo.apk \
146-
spoo.apk.sha256
153+
spoo.apk.sha256 \
154+
version.txt
147155
148156
- name: Shred the key
149157
if: always()

0 commit comments

Comments
 (0)