mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CI: tolerate missing Android i686 ABI; brew-first CocoaPods install
Android: - monero_c prebuilt bundle doesn't ship i686-linux-android (32-bit x86 Android — essentially extinct, sim/emulators use x86_64). Was failing loud on the missing target. Now: missing target = skip + log; only the truly-modern ABIs (arm64-v8a, x86_64) are REQUIRED. armeabi-v7a (32-bit ARM) is shipped if available but not required. The resulting APK is universal across whichever ABIs got staged. iOS: - 'sudo gem install cocoapods' was hitting a password prompt because the Gitea runner user has no passwordless sudo configured (rightly). Switched to brew-first install (Homebrew lives in its own prefix, no sudo needed on Mac). Falls back to 'gem install --user-install' (no sudo) if brew is somehow unavailable. The whole step is still no-op if 'pod' is already on PATH.
This commit is contained in:
@@ -101,26 +101,50 @@ jobs:
|
||||
MONERO_C_TAG=$(cd scripts/monero_c && git describe --tags)
|
||||
BUNDLE_DIR="scripts/monero_c/release/$MONERO_C_TAG"
|
||||
|
||||
# monero_c target dir → Android ABI dir
|
||||
# monero_c target dir → Android ABI dir. i686 (32-bit x86) is
|
||||
# essentially dead on real Android devices; the monero_c bundle
|
||||
# doesn't ship it. Missing target = log + skip, not fatal. The
|
||||
# required modern ABIs (arm64-v8a, x86_64) MUST exist or we fail.
|
||||
declare -A ABI_MAP=(
|
||||
[aarch64-linux-android]=arm64-v8a
|
||||
[armv7a-linux-androideabi]=armeabi-v7a
|
||||
[i686-linux-android]=x86
|
||||
[x86_64-linux-android]=x86_64
|
||||
)
|
||||
REQUIRED_ABIS=(arm64-v8a x86_64)
|
||||
|
||||
declare -A FOUND_ABI
|
||||
for target in "${!ABI_MAP[@]}"; do
|
||||
abi="${ABI_MAP[$target]}"
|
||||
if [[ ! -d "$BUNDLE_DIR/$target" ]]; then
|
||||
echo "SKIP: $target not in bundle (Android ABI $abi will not be shipped)"
|
||||
continue
|
||||
fi
|
||||
mkdir -p "android/app/src/main/jniLibs/$abi"
|
||||
ok=true
|
||||
for coin in monero wownero; do
|
||||
src="$BUNDLE_DIR/$target/lib${coin}_wallet2_api_c.so"
|
||||
if [[ -f "$src" ]]; then
|
||||
cp -v "$src" "android/app/src/main/jniLibs/$abi/"
|
||||
else
|
||||
echo "MISSING: $src — fail loud, the bundle layout may have changed"
|
||||
exit 1
|
||||
echo "SKIP: $src missing (skipping $abi)"
|
||||
ok=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
if $ok; then
|
||||
FOUND_ABI[$abi]=1
|
||||
else
|
||||
rm -rf "android/app/src/main/jniLibs/$abi"
|
||||
fi
|
||||
done
|
||||
|
||||
# Fail loudly only if a required ABI is missing.
|
||||
for required in "${REQUIRED_ABIS[@]}"; do
|
||||
if [[ -z "${FOUND_ABI[$required]:-}" ]]; then
|
||||
echo "FATAL: required ABI $required is missing — monero_c bundle layout has changed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "=== jniLibs contents ==="
|
||||
|
||||
@@ -58,8 +58,20 @@ jobs:
|
||||
|
||||
- name: Install CocoaPods (if missing)
|
||||
run: |
|
||||
if ! command -v pod >/dev/null; then
|
||||
sudo gem install cocoapods --no-document
|
||||
if command -v pod >/dev/null; then
|
||||
pod --version
|
||||
exit 0
|
||||
fi
|
||||
# Prefer Homebrew on macOS — no sudo, installs into its own prefix.
|
||||
if command -v brew >/dev/null; then
|
||||
brew install cocoapods
|
||||
else
|
||||
# Fallback: user-local gem install (no sudo).
|
||||
export GEM_HOME="$HOME/.gem"
|
||||
export PATH="$GEM_HOME/bin:$PATH"
|
||||
echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV"
|
||||
echo "$HOME/.gem/bin" >> "$GITHUB_PATH"
|
||||
gem install --user-install cocoapods --no-document
|
||||
fi
|
||||
pod --version
|
||||
|
||||
|
||||
@@ -61,8 +61,18 @@ jobs:
|
||||
|
||||
- name: Install CocoaPods (if missing)
|
||||
run: |
|
||||
if ! command -v pod >/dev/null; then
|
||||
sudo gem install cocoapods --no-document
|
||||
if command -v pod >/dev/null; then
|
||||
pod --version
|
||||
exit 0
|
||||
fi
|
||||
if command -v brew >/dev/null; then
|
||||
brew install cocoapods
|
||||
else
|
||||
export GEM_HOME="$HOME/.gem"
|
||||
export PATH="$GEM_HOME/bin:$PATH"
|
||||
echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV"
|
||||
echo "$HOME/.gem/bin" >> "$GITHUB_PATH"
|
||||
gem install --user-install cocoapods --no-document
|
||||
fi
|
||||
pod --version
|
||||
|
||||
|
||||
Reference in New Issue
Block a user