mirror of
https://github.com/mattintech/AndroidTestApp.git
synced 2026-07-11 11:51:53 +00:00
Update GitHub Actions workflow to use versioned artifact names
Changed artifact naming from app-release.apk to AndroidTestApp-<version>.apk where version is extracted from the git tag (e.g., AndroidTestApp-v1.0.0.apk) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
41
.github/workflows/android-release.yml
vendored
41
.github/workflows/android-release.yml
vendored
@@ -56,23 +56,28 @@ jobs:
|
|||||||
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
|
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
|
||||||
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
|
-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
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: app-release
|
name: AndroidTestApp-${{ steps.tag.outputs.tag }}
|
||||||
path: app/build/outputs/apk/release/app-release.apk
|
path: app/build/outputs/apk/release/app-release.apk
|
||||||
|
|
||||||
# Step 7: 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 8: Run tests (optional but recommended)
|
# Step 9: Run tests (optional but recommended)
|
||||||
- name: Run Unit Tests
|
- name: Run Unit Tests
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
|
|
||||||
# Step 9: Upload test results
|
# Step 10: Upload test results
|
||||||
- name: Upload Test Results
|
- name: Upload Test Results
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
@@ -92,19 +97,23 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# Step 2: Download APK artifact
|
# Step 2: Get the tag name
|
||||||
- name: Download APK
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: app-release
|
|
||||||
path: ./artifacts
|
|
||||||
|
|
||||||
# Step 3: Get the tag name
|
|
||||||
- name: Get tag name
|
- name: Get tag name
|
||||||
id: tag
|
id: tag
|
||||||
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
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
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
@@ -127,11 +136,11 @@ jobs:
|
|||||||
|
|
||||||
---
|
---
|
||||||
*This release was automatically generated by GitHub Actions*
|
*This release was automatically generated by GitHub Actions*
|
||||||
files: ./artifacts/app-release.apk
|
files: ./artifacts/AndroidTestApp-${{ steps.tag.outputs.tag }}.apk
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
# Step 5: Clean up artifacts
|
# Step 6: Clean up artifacts
|
||||||
- name: Clean up artifacts
|
- name: Clean up artifacts
|
||||||
if: always()
|
if: always()
|
||||||
run: rm -rf ./artifacts
|
run: rm -rf ./artifacts
|
||||||
|
|||||||
Reference in New Issue
Block a user