Skip to content

Commit

Permalink
Fix android paths and uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
erskingardner committed Jan 11, 2025
1 parent 75c49e3 commit 59838c8
Showing 1 changed file with 24 additions and 52 deletions.
76 changes: 24 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,6 @@ jobs:
find src-tauri/gen/android/app/build/outputs/apk/*/release/*.apk -type f
find src-tauri/gen/android/app/build/outputs/bundle/universalRelease/*.aab -type f
# Add this before the artifact upload steps
- name: Generate artifact hashes
if: matrix.android
run: |
cd src-tauri/gen/android/app/build/outputs
# Generate hash for each APK
find . -type f -name "*.apk" -exec sh -c '
sha256sum "$1" > "${1}.sha256"
' sh {} \;
# Generate hash for AAB
find . -type f -name "*.aab" -exec sh -c '
sha256sum "$1" > "${1}.sha256"
' sh {} \;
- name: Generate desktop artifact hashes
if: ${{ !matrix.android }}
run: |
Expand Down Expand Up @@ -265,36 +251,30 @@ jobs:
echo "Version: $VERSION"
mkdir -p android-artifacts
# Copy and rename AAB with version
find src-tauri/gen/android/app/build/outputs/bundle/universalRelease -name "*.aab" -exec sh -c '
cp "$1" android-artifacts/whitenoise-'"$VERSION"'-android-universal.aab
cp "${1}.sha256" android-artifacts/whitenoise-'"$VERSION"'-android-universal.aab.sha256
' sh {} \;
cp "src-tauri/gen/android/app/build/outputs/bundle/universalRelease/app-universal-release.aab" \
"android-artifacts/whitenoise-${VERSION}-android-universal.aab"
cp "src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk" \
"android-artifacts/whitenoise-${VERSION}-android-universal.apk"
cp "src-tauri/gen/android/app/build/outputs/apk/arm64/release/app-arm64-release.apk" \
"android-artifacts/whitenoise-${VERSION}-android-arm64.apk"
cp "src-tauri/gen/android/app/build/outputs/apk/arm/release/app-arm-release.apk" \
"android-artifacts/whitenoise-${VERSION}-android-arm.apk"
# Copy and rename APKs with version and their ABI
find src-tauri/gen/android/app/build/outputs/apk/*/release -name "*.apk" -exec sh -c '
filename=$(basename "$1")
case "$filename" in
*arm64-v8a*)
cp "$1" android-artifacts/whitenoise-'"$VERSION"'-android-arm64-v8a.apk
cp "${1}.sha256" android-artifacts/whitenoise-'"$VERSION"'-android-arm64-v8a.apk.sha256
;;
*armeabi-v7a*)
cp "$1" android-artifacts/whitenoise-'"$VERSION"'-android-armeabi-v7a.apk
cp "${1}.sha256" android-artifacts/whitenoise-'"$VERSION"'-android-armeabi-v7a.apk.sha256
;;
*x86_64*)
cp "$1" android-artifacts/whitenoise-'"$VERSION"'-android-x86_64.apk
cp "${1}.sha256" android-artifacts/whitenoise-'"$VERSION"'-android-x86_64.apk.sha256
;;
*x86_32*|*x86[^_]*) # More specific pattern for x86 (32-bit)
cp "$1" android-artifacts/whitenoise-'"$VERSION"'-android-x86.apk
cp "${1}.sha256" android-artifacts/whitenoise-'"$VERSION"'-android-x86.apk.sha256
;;
*)
echo "Warning: Unrecognized APK architecture in filename: $filename"
;;
esac
cp "src-tauri/gen/android/app/build/outputs/apk/x86/release/app-x86-release.apk" \
"android-artifacts/whitenoise-${VERSION}-android-x86.apk"
cp "src-tauri/gen/android/app/build/outputs/apk/x86_64/release/app-x86_64-release.apk" \
"android-artifacts/whitenoise-${VERSION}-android-x86_64.apk"
- name: Generate Android artifact hashes
if: matrix.android
run: |
cd android-artifacts
find . -type f -exec sh -c '
sha256sum "$1" > "${1}.sha256"
' sh {} \;
- name: List Android artifacts
Expand All @@ -306,17 +286,9 @@ jobs:
if: matrix.android
uses: actions/upload-artifact@v4
with:
name: android-releases
name: android
path: android-artifacts/*

- name: Upload Android sha256 hashes
if: matrix.android
uses: actions/upload-artifact@v4
with:
path: |
src-tauri/gen/android/app/build/outputs/apk/*/release/*.apk.sha256
src-tauri/gen/android/app/build/outputs/bundle/universalRelease/*.aab.sha256
- name: Prepare Desktop artifacts
if: ${{ !matrix.android }}
run: |
Expand Down

0 comments on commit 59838c8

Please sign in to comment.