diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index c5f6dde..29863c8 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -56,23 +56,28 @@ jobs: -Pandroid.injected.signing.key.alias=$KEY_ALIAS \ -Pandroid.injected.signing.key.password=$KEY_PASSWORD - # Step 6: Upload APK as artifact + # Step 6: Get the tag name for artifact naming + - name: Get tag name + id: tag + run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + # Step 7: Upload APK as artifact with versioned name - name: Upload APK uses: actions/upload-artifact@v4 with: - name: app-release + name: AndroidTestApp-${{ steps.tag.outputs.tag }} path: app/build/outputs/apk/release/app-release.apk - # Step 7: Clean up keystore + # Step 8: Clean up keystore - name: Clean up keystore if: always() run: rm -f ${{ github.workspace }}/keystore.jks - # Step 8: Run tests (optional but recommended) + # Step 9: Run tests (optional but recommended) - name: Run Unit Tests run: ./gradlew test - # Step 9: Upload test results + # Step 10: Upload test results - name: Upload Test Results uses: actions/upload-artifact@v4 if: always() @@ -92,19 +97,23 @@ jobs: with: fetch-depth: 0 - # Step 2: Download APK artifact - - name: Download APK - uses: actions/download-artifact@v4 - with: - name: app-release - path: ./artifacts - - # Step 3: Get the tag name + # Step 2: Get the tag name - name: Get tag name id: tag run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - # Step 4: Create GitHub Release + # Step 3: Download APK artifact + - name: Download APK + uses: actions/download-artifact@v4 + with: + name: AndroidTestApp-${{ steps.tag.outputs.tag }} + path: ./artifacts + + # Step 4: Rename APK file + - name: Rename APK + run: mv ./artifacts/app-release.apk ./artifacts/AndroidTestApp-${{ steps.tag.outputs.tag }}.apk + + # Step 5: Create GitHub Release - name: Create Release uses: softprops/action-gh-release@v1 with: @@ -127,11 +136,11 @@ jobs: --- *This release was automatically generated by GitHub Actions* - files: ./artifacts/app-release.apk + files: ./artifacts/AndroidTestApp-${{ steps.tag.outputs.tag }}.apk draft: false prerelease: false - # Step 5: Clean up artifacts + # Step 6: Clean up artifacts - name: Clean up artifacts if: always() run: rm -rf ./artifacts