implement ota updates
lint / ruff (push) Successful in 14s
tests / desktop (push) Successful in 22s
docker / image (push) Successful in 43s
tests / web (push) Successful in 39s
tests / android-core (push) Successful in 1m1s
tests / backend (push) Successful in 2m12s
android / apk (push) Successful in 6m50s

This commit is contained in:
timka123 committed 2026-10-22 21:11:04 +03:00
1 parent 61529be465
commit 1bdd65cc76
25 files changed
+2353 -4

No files matched your search

+40
View File
@@ -74,6 +74,16 @@ jobs:
printf '%s' "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/kadence.keystore"
echo "signed=true" >> "$GITHUB_OUTPUT"
- name: Resolve the version name
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
VERSION="0.1.0-master.${{ gitea.run_number }}"
fi
echo "KADENCE_VERSION_NAME=$VERSION" >> "$GITHUB_ENV"
echo "Resolved version $VERSION"
- name: Build the release APK
working-directory: android
env:
@@ -103,12 +113,42 @@ jobs:
fi
fi
# A small, separately uploaded description of the APK. The backend's OTA
# endpoint reads this artifact on every check; keeping it out of the APK
# artifact avoids downloading tens of megabytes just to ask "is there a
# newer build?".
- name: Write the update metadata
run: |
APK=android/app/build/outputs/apk/release/app-release.apk
META_DIR=android/app/build/outputs/update
mkdir -p "$META_DIR"
APKSIGNER="$(find "$ANDROID_HOME/build-tools" -name apksigner | sort | tail -1)"
SIGNER_SHA256="$("$APKSIGNER" verify --print-certs "$APK" \
| sed -n 's/^Signer #1 certificate SHA-256 digest: //p' | head -1)"
printf '{\n "version_code": %s,\n "version_name": "%s",\n "commit": "%s",\n "built_at": "%s",\n "size_bytes": %s,\n "sha256": "%s",\n "signer_sha256": "%s"\n}\n' \
"${{ gitea.run_number }}" \
"$KADENCE_VERSION_NAME" \
"$GITHUB_SHA" \
"$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
"$(stat -c%s "$APK")" \
"$(sha256sum "$APK" | cut -d' ' -f1)" \
"$SIGNER_SHA256" > "$META_DIR/update.json"
cat "$META_DIR/update.json"
- uses: actions/upload-artifact@v3
with:
name: kadence-release-apk
path: android/app/build/outputs/apk/release/app-release.apk
if-no-files-found: error
- uses: actions/upload-artifact@v3
with:
name: kadence-update-metadata
path: android/app/build/outputs/update/update.json
if-no-files-found: error
- name: Attach it to the release, when this is a tag
if: startsWith(github.ref, 'refs/tags/v')
env: