From 5c8aba646611b6d707f344b1856e06e8e8b84217 Mon Sep 17 00:00:00 2001 From: Matt Hills Date: Thu, 3 Jul 2025 19:55:45 -0400 Subject: [PATCH] fixing how apk rename is done --- .github/workflows/android-release.yml | 32 ++++++++++++--------------- app/build.gradle.kts | 2 +- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 5b5586d..0ab870c 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -65,26 +65,14 @@ jobs: - name: Upload APK uses: actions/upload-artifact@v4 with: - name: lchat-${{ steps.tag.outputs.tag }} - path: app/build/outputs/apk/release/app-release.apk + name: localchat-${{ steps.tag.outputs.tag }} + path: app/build/outputs/apk/release/localchat-*-release.apk # Step 8: Clean up keystore - name: Clean up keystore if: always() run: rm -f ${{ github.workspace }}/keystore.jks - # Step 9: Run tests (optional but recommended) - - name: Run Unit Tests - run: ./gradlew test - - # Step 10: Upload test results - - name: Upload Test Results - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-results - path: app/build/test-results/ - release: name: Create GitHub Release needs: build @@ -106,12 +94,20 @@ jobs: - name: Download APK uses: actions/download-artifact@v4 with: - name: lchat-${{ steps.tag.outputs.tag }} + name: localchat-${{ steps.tag.outputs.tag }} path: ./artifacts # Step 4: Rename APK file - name: Rename APK - run: mv ./artifacts/app-release.apk ./artifacts/lchat-${{ steps.tag.outputs.tag }}.apk + run: | + # Find the APK file (should be localchat-*-release.apk) + APK_FILE=$(find ./artifacts -name "localchat-*-release.apk" | head -n 1) + if [ -z "$APK_FILE" ]; then + echo "Error: No APK file found" + exit 1 + fi + # Rename to include tag version + mv "$APK_FILE" "./artifacts/localchat-${{ steps.tag.outputs.tag }}.apk" # Step 5: Create GitHub Release - name: Create Release @@ -120,7 +116,7 @@ jobs: tag_name: ${{ steps.tag.outputs.tag }} name: Release ${{ steps.tag.outputs.tag }} body: | - ## LChat Release + ## LocalChat Release ### What's New - Built from commit: ${{ github.sha }} @@ -136,7 +132,7 @@ jobs: --- *This release was automatically generated by GitHub Actions* - files: ./artifacts/lchat-${{ steps.tag.outputs.tag }}.apk + files: ./artifacts/localchat-${{ steps.tag.outputs.tag }}.apk draft: false prerelease: false diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 607d5f4..63a67e1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -37,7 +37,7 @@ android { variant.outputs .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } .forEach { output -> - val outputFileName = "lchat-${variant.versionName}-${variant.name}.apk" + val outputFileName = "localchat-${variant.versionName}-${variant.name}.apk" output.outputFileName = outputFileName } }