4 Commits

Author SHA1 Message Date
Hermes
052ea8de4c ci: verify Android bundles ship native git
Some checks failed
Android build / build (push) Failing after 38s
Android build / build (release) Failing after 53s
2026-08-31 18:53:02 -05:00
Hermes
9c77cdc3a3 ci: compile bundled git for Android builds
Some checks failed
Android build / build (push) Failing after 1m13s
2026-08-31 18:51:08 -05:00
Hermes
b5fea9e010 ci: prefer github token for release asset upload
All checks were successful
Android build / build (push) Successful in 9m6s
Android build / build (release) Successful in 11m31s
2026-08-31 17:52:41 -05:00
Hermes
df07409e48 ci: broaden release asset upload token fallback
Some checks failed
Android build / build (push) Has been cancelled
2026-08-31 16:12:17 -05:00

View File

@@ -1,7 +1,7 @@
name: Android build name: Android build
permissions: permissions:
contents: read contents: write
releases: write releases: write
on: on:
@@ -96,6 +96,15 @@ jobs:
set -euxo pipefail set -euxo pipefail
printf 'sdk.dir=%s/.android/sdk\n' "$HOME" > local.properties printf 'sdk.dir=%s/.android/sdk\n' "$HOME" > local.properties
- name: Compile bundled native Git binaries
shell: bash
run: |
set -euxo pipefail
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
export ANDROID_HOME="$ANDROID_SDK_ROOT"
chmod +x ./AndroidProjectTooling.sh
bash ./AndroidProjectTooling.sh --compile-git
- name: Prepare CI build metadata - name: Prepare CI build metadata
id: build_meta id: build_meta
shell: bash shell: bash
@@ -128,6 +137,28 @@ jobs:
export ANDROID_HOME="$ANDROID_SDK_ROOT" export ANDROID_HOME="$ANDROID_SDK_ROOT"
./gradlew --no-daemon clean assembleDebug ./gradlew --no-daemon clean assembleDebug
- name: Verify debug APK bundles native Git
if: github.event_name != 'release'
shell: bash
run: |
set -euxo pipefail
python3 - <<'PY'
from pathlib import Path
import zipfile
apk = next(Path('app/build/outputs/apk/debug').glob('*.apk'))
with zipfile.ZipFile(apk) as zf:
names = zf.namelist()
required = {
'lib/arm64-v8a/libgit.so',
'lib/armeabi-v7a/libgit.so',
}
found = {name for name in names if name in required}
print('APK_NATIVE_GIT', sorted(found))
missing = sorted(required - found)
if missing:
raise SystemExit(f'Missing native Git libraries in {apk}: {missing}')
PY
- name: Build release AAB - name: Build release AAB
if: github.event_name == 'release' if: github.event_name == 'release'
shell: bash shell: bash
@@ -137,6 +168,28 @@ jobs:
export ANDROID_HOME="$ANDROID_SDK_ROOT" export ANDROID_HOME="$ANDROID_SDK_ROOT"
./gradlew --no-daemon bundleRelease ./gradlew --no-daemon bundleRelease
- name: Verify release AAB bundles native Git
if: github.event_name == 'release'
shell: bash
run: |
set -euxo pipefail
python3 - <<'PY'
from pathlib import Path
import zipfile
aab = next(Path('app/build/outputs/bundle/release').glob('*.aab'))
with zipfile.ZipFile(aab) as zf:
names = zf.namelist()
required = {
'base/lib/arm64-v8a/libgit.so',
'base/lib/armeabi-v7a/libgit.so',
}
found = {name for name in names if name in required}
print('AAB_NATIVE_GIT', sorted(found))
missing = sorted(required - found)
if missing:
raise SystemExit(f'Missing native Git libraries in {aab}: {missing}')
PY
- name: Rename release AAB for upload - name: Rename release AAB for upload
if: github.event_name == 'release' if: github.event_name == 'release'
id: release_aab id: release_aab
@@ -161,13 +214,19 @@ jobs:
if: github.event_name == 'release' if: github.event_name == 'release'
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
shell: bash shell: bash
run: | run: |
set -euxo pipefail set -euxo pipefail
token="${GITHUB_TOKEN:-${GITEA_TOKEN:-}}"
if [ -z "$token" ]; then
echo "::error::No release upload token is available from secrets.GITEA_TOKEN or github.token"
exit 1
fi
release_id="$(python3 -c 'import json, os; print(json.load(open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8"))["release"]["id"])')" release_id="$(python3 -c 'import json, os; print(json.load(open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8"))["release"]["id"])')"
aab="${{ steps.release_aab.outputs.path }}" aab="${{ steps.release_aab.outputs.path }}"
curl --fail-with-body \ curl --fail-with-body \
--request POST \ --request POST \
--header "Authorization: token ***" \ --header "Authorization: token ${token}" \
--form "attachment=@${aab}" \ --form "attachment=@${aab}" \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=$(basename "$aab")" "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=$(basename "$aab")"