Skip to content

Commit 2ae45fb

Browse files
committed
fix(repro): preserve APKs before clean in per-ABI builds
The clean step was deleting previously built APKs. Now each APK is moved to final_apks/ directory before the next ABI's clean. v1.1.64 — Opus 4.5
1 parent 0b6caeb commit 2ae45fb

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,8 @@ jobs:
122122
# Building all ABIs together causes different AAPT2 resource compilation
123123
- name: Build APKs per-ABI (matching F-Droid)
124124
run: |
125-
mkdir -p build/outputs/apk/release
126-
127-
# Array of ABIs to build (matching F-Droid metadata order)
128-
declare -A ABI_MAP=(
129-
["armeabi-v7a"]="armeabi-v7a"
130-
["arm64-v8a"]="arm64-v8a"
131-
["x86_64"]="x86_64"
132-
)
125+
# Create final output directory (separate from build/outputs to survive clean)
126+
mkdir -p final_apks
133127
134128
for ABI in armeabi-v7a arm64-v8a x86_64; do
135129
echo "========================================="
@@ -151,12 +145,13 @@ jobs:
151145
# Clean and build this single ABI
152146
./gradlew clean assembleRelease --stacktrace --no-build-cache
153147
154-
# Find and rename the output APK
148+
# Find the output APK
155149
BUILT_APK=$(find build/outputs/apk/release -name "*.apk" -type f | head -1)
156150
if [ -n "$BUILT_APK" ]; then
157151
# Extract version from filename
158152
VERSION_NAME=$(echo "$BUILT_APK" | grep -oP 'v\d+\.\d+\.\d+' || echo "v${{ env.VERSION }}")
159153
FINAL_NAME="CleverKeys-${VERSION_NAME}-${ABI}.apk"
154+
FINAL_PATH="final_apks/$FINAL_NAME"
160155
161156
# Apply F-Droid postbuild steps to this APK
162157
echo "📦 Applying reproducibility fixes to $FINAL_NAME..."
@@ -168,12 +163,9 @@ jobs:
168163
python3 ${{ github.workspace }}/reproducible-apk-tools/inplace-fix.py \
169164
--page-size 16 --internal fix-pg-map-id "$BUILT_APK" 0000000
170165
171-
# Rename if needed (Gradle may already use correct name)
172-
FINAL_PATH="build/outputs/apk/release/$FINAL_NAME"
173-
if [ "$BUILT_APK" != "$FINAL_PATH" ]; then
174-
mv "$BUILT_APK" "$FINAL_PATH"
175-
fi
176-
echo "✅ Built: $FINAL_NAME"
166+
# Move to final directory (survives clean)
167+
mv "$BUILT_APK" "$FINAL_PATH"
168+
echo "✅ Built: $FINAL_NAME → saved to $FINAL_PATH"
177169
else
178170
echo "❌ ERROR: No APK found for $ABI"
179171
exit 1
@@ -185,6 +177,10 @@ jobs:
185177
# Restore original build.gradle
186178
git checkout build.gradle
187179
180+
# Copy all APKs to expected location for release step
181+
mkdir -p build/outputs/apk/release
182+
cp final_apks/*.apk build/outputs/apk/release/
183+
188184
echo "========================================="
189185
echo "📦 All APKs built:"
190186
ls -la build/outputs/apk/release/*.apk

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050
// UPDATE ONLY THESE THREE VALUES FOR A NEW RELEASE:
5151
ext.VERSION_MAJOR = 1
5252
ext.VERSION_MINOR = 1
53-
ext.VERSION_PATCH = 63
53+
ext.VERSION_PATCH = 64
5454
// =============================================================================
5555
// DERIVED VALUES (auto-calculated, do not edit):
5656
// - versionCode = MAJOR*10000 + MINOR*100 + PATCH

0 commit comments

Comments
 (0)