Fix
Some checks failed
Build and Release / build-and-release (push) Failing after 11m45s

This commit is contained in:
Bryan1029384756
2026-02-18 17:39:03 -06:00
parent dea348def2
commit 0e6f46ebdd
2 changed files with 1748 additions and 2 deletions

View File

@@ -108,6 +108,39 @@ jobs:
run: | run: |
npx cap add android npx cap add android
echo "sdk.dir=${ANDROID_SDK_ROOT}" > android/local.properties echo "sdk.dir=${ANDROID_SDK_ROOT}" > android/local.properties
# Inject signing config into the generated build.gradle
node -e "
const fs = require('fs');
const p = 'android/app/build.gradle';
let g = fs.readFileSync(p, 'utf8');
const signingBlock = \`
android {
signingConfigs {
release {
storeFile file(System.getenv('ANDROID_KEYSTORE_FILE') ?: '/dev/null')
storePassword System.getenv('ANDROID_KEYSTORE_PASSWORD') ?: ''
keyAlias System.getenv('ANDROID_KEY_ALIAS') ?: ''
keyPassword System.getenv('ANDROID_KEY_PASSWORD') ?: ''
}
}
}
\`;
// Append a separate android block with signingConfigs (Gradle merges them)
g += signingBlock;
// Add signingConfig to the release buildType
g = g.replace(
/(buildTypes\\s*\\{[\\s\\S]*?release\\s*\\{)/,
'\$1\\n signingConfig signingConfigs.release'
);
fs.writeFileSync(p, g);
console.log('Patched build.gradle with signing config');
"
npx cap sync android npx cap sync android
working-directory: apps/android working-directory: apps/android
@@ -120,8 +153,17 @@ jobs:
- name: Copy APK to dist - name: Copy APK to dist
run: | run: |
VERSION="${{ steps.version.outputs.version }}" VERSION="${{ steps.version.outputs.version }}"
cp apps/android/android/app/build/outputs/apk/release/app-release.apk \ APK_DIR="apps/android/android/app/build/outputs/apk/release"
apps/electron/dist/DiscordClone-v${VERSION}.apk if [ -f "$APK_DIR/app-release.apk" ]; then
cp "$APK_DIR/app-release.apk" "apps/electron/dist/DiscordClone-v${VERSION}.apk"
elif [ -f "$APK_DIR/app-release-unsigned.apk" ]; then
echo "Warning: APK is unsigned (signing secrets may be missing)"
cp "$APK_DIR/app-release-unsigned.apk" "apps/electron/dist/DiscordClone-v${VERSION}.apk"
else
echo "Error: No APK found in $APK_DIR"
ls -la "$APK_DIR/" 2>/dev/null || echo "Directory does not exist"
exit 1
fi
- name: List build artifacts - name: List build artifacts
run: ls -la apps/electron/dist/ run: ls -la apps/electron/dist/

1704
logs/log1.txt Normal file

File diff suppressed because it is too large Load Diff