From 2256b8222c68b4d7df9e57de2e6cb663db84fa76 Mon Sep 17 00:00:00 2001 From: Damontecres Date: Sun, 16 Nov 2025 17:41:43 -0500 Subject: [PATCH] Fix CI workflows --- .github/workflows/main.yml | 23 ++++++++++++----------- .github/workflows/release.yml | 26 +++++++++++++------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 277807be..4a8b26a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,26 +56,27 @@ jobs: SIGNING_KEY: "${{ secrets.SIGNING_KEY }}" run: | ./gradlew clean assembleRelease assembleDebug - echo "apks=$(find app/build/outputs/apk -name '*.apk' | sort)" >> "$GITHUB_OUTPUT" - name: Verify signatures run: | echo "Verify APK signatures" - while IFS= read -r line; do - ${{env.ANDROID_SDK_ROOT}}/build-tools/${{ env.BUILD_TOOLS_VERSION }}/apksigner verify --verbose --print-certs "$line" - done <<< "${{ steps.build.outputs.apks }}" + find app/build/outputs/apk -name '*.apk' + find app/build/outputs/apk -name '*.apk' -print0 | xargs -t -0 -n1 ${{env.ANDROID_SDK_ROOT}}/build-tools/${{ env.BUILD_TOOLS_VERSION }}/apksigner verify --verbose --print-certs - name: Copy APK to shorter names id: apks run: | - while IFS= read -r line; do - # Wholphin-debug-0.2.9-62-g5c12e03-16-arm64-v8a.apk => Wholphin-debug-arm64-v8a.apk - short_name="$(echo $line | sed -E 's/-[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[a-fA-F0-9]+-[0-9]+//')" - echo "$line => $short_name" - cp "$line" "$short_name" - done <<< "${{ steps.build.outputs.apks }}" + find app/build/outputs/apk -name '*.apk' -print0 | + while IFS= read -r -d '' line; do + # Wholphin-debug-0.2.9-62-g5c12e03-16-arm64-v8a.apk => Wholphin-debug-arm64-v8a.apk + short_name="$(echo $line | sed -E 's/-[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[a-fA-F0-9]+-[0-9]+//')" + echo "$line => $short_name" + cp "$line" "$short_name" + done + apks=$(find app/build/outputs/apk -name '*.apk' -print0 | tr '\0' ',' | sed 's/,$//') + echo "apks=$apks" >> "$GITHUB_OUTPUT" - name: Checksums run: | echo "SHA256 checksums:" - find app/build/outputs/apk -name '*.apk' | xargs sha256sum + find app/build/outputs/apk -name '*.apk' -print0 | xargs -0 sha256sum - name: Delete ${{ env.TAG_NAME }} tag and release uses: dev-drprasad/delete-tag-and-release@v1.1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92967b24..454fe48d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,27 +37,27 @@ jobs: SIGNING_KEY: "${{ secrets.SIGNING_KEY }}" run: | ./gradlew clean assembleRelease - echo "apks=$(find app/build/outputs/apk -name '*.apk' | sort)" >> "$GITHUB_OUTPUT" - name: Verify signatures run: | echo "Verify APK signatures" - while IFS= read -r line; do - ${{env.ANDROID_SDK_ROOT}}/build-tools/${{ env.BUILD_TOOLS_VERSION }}/apksigner verify --verbose --print-certs "$line" - done <<< "${{ steps.build.outputs.apks }}" - - - name: Copy APK to ${{ env.APK_SHORT_NAME }} + find app/build/outputs/apk -name '*.apk' + find app/build/outputs/apk -name '*.apk' -print0 | xargs -0 -n1 ${{env.ANDROID_SDK_ROOT}}/build-tools/${{ env.BUILD_TOOLS_VERSION }}/apksigner verify --verbose --print-certs + - name: Copy APK to shorter names id: apks run: | - while IFS= read -r line; do - short_name="$(echo $line | sed -E 's/-release-[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[a-fA-F0-9]+-[0-9]+//')" - echo "$line $short_name" - cp "$line" "$short_name" - done <<< "${{ steps.build.outputs.apks }}" - echo "apks=$(find app/build/outputs/apk -name '*.apk' -print0 | tr '\0' ',' | sed 's/,$//')" >> "$GITHUB_OUTPUT" + find app/build/outputs/apk -name '*.apk' -print0 | + while IFS= read -r -d '' line; do + # Wholphin-debug-0.2.9-62-g5c12e03-16-arm64-v8a.apk => Wholphin-debug-arm64-v8a.apk + short_name="$(echo $line | sed -E 's/-[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[a-fA-F0-9]+-[0-9]+//')" + echo "$line => $short_name" + #cp "$line" "$short_name" + done + apks=$(find app/build/outputs/apk -name '*.apk' -print0 | tr '\0' ',' | sed 's/,$//') + echo "apks=$apks" >> "$GITHUB_OUTPUT" - name: Checksums run: | echo "SHA256 checksums:" - find app/build/outputs/apk -name '*.apk' | xargs sha256sum + find app/build/outputs/apk -name '*.apk' -print0 | xargs -0 sha256sum - name: Create GitHub release uses: ncipollo/release-action@v1 with: