fixing how apk rename is done

This commit is contained in:
2025-07-03 19:55:45 -04:00
parent 9f0a5621a5
commit 5c8aba6466
2 changed files with 15 additions and 19 deletions

View File

@@ -65,26 +65,14 @@ jobs:
- name: Upload APK - name: Upload APK
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: lchat-${{ steps.tag.outputs.tag }} name: localchat-${{ steps.tag.outputs.tag }}
path: app/build/outputs/apk/release/app-release.apk path: app/build/outputs/apk/release/localchat-*-release.apk
# Step 8: Clean up keystore # Step 8: Clean up keystore
- name: Clean up keystore - name: Clean up keystore
if: always() if: always()
run: rm -f ${{ github.workspace }}/keystore.jks 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: release:
name: Create GitHub Release name: Create GitHub Release
needs: build needs: build
@@ -106,12 +94,20 @@ jobs:
- name: Download APK - name: Download APK
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: lchat-${{ steps.tag.outputs.tag }} name: localchat-${{ steps.tag.outputs.tag }}
path: ./artifacts path: ./artifacts
# Step 4: Rename APK file # Step 4: Rename APK file
- name: Rename APK - 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 # Step 5: Create GitHub Release
- name: Create Release - name: Create Release
@@ -120,7 +116,7 @@ jobs:
tag_name: ${{ steps.tag.outputs.tag }} tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }} name: Release ${{ steps.tag.outputs.tag }}
body: | body: |
## LChat Release ## LocalChat Release
### What's New ### What's New
- Built from commit: ${{ github.sha }} - Built from commit: ${{ github.sha }}
@@ -136,7 +132,7 @@ jobs:
--- ---
*This release was automatically generated by GitHub Actions* *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 draft: false
prerelease: false prerelease: false

View File

@@ -37,7 +37,7 @@ android {
variant.outputs variant.outputs
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
.forEach { output -> .forEach { output ->
val outputFileName = "lchat-${variant.versionName}-${variant.name}.apk" val outputFileName = "localchat-${variant.versionName}-${variant.name}.apk"
output.outputFileName = outputFileName output.outputFileName = outputFileName
} }
} }