mirror of
https://github.com/cmclark00/TetriStats.git
synced 2025-05-18 07:05:20 +01:00
Update GitHub workflow to customize APK filename with TetriStats name and version
This commit is contained in:
parent
d350cf190b
commit
782377408b
1 changed files with 31 additions and 11 deletions
42
.github/workflows/build.yml
vendored
42
.github/workflows/build.yml
vendored
|
@ -29,21 +29,41 @@ jobs:
|
|||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Build Release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Upload APK as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: app/build/outputs/apk/release/app-release-unsigned.apk
|
||||
|
||||
- name: Get version name from build.gradle
|
||||
id: version
|
||||
run: |
|
||||
VERSION_NAME=$(grep -o 'versionName = "[^"]*' app/build.gradle.kts | cut -d'"' -f2)
|
||||
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
||||
echo "APP_VERSION=$VERSION_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build Release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Rename APK for tag release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
mkdir -p renamed_apk
|
||||
cp app/build/outputs/apk/release/app-release-unsigned.apk renamed_apk/TetriStats-${{ env.VERSION_NAME }}.apk
|
||||
|
||||
- name: Rename APK for push release
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
|
||||
run: |
|
||||
mkdir -p renamed_apk
|
||||
cp app/build/outputs/apk/release/app-release-unsigned.apk renamed_apk/TetriStats-${{ env.VERSION_NAME }}-${{ github.run_number }}.apk
|
||||
|
||||
- name: Upload APK as artifact for tag release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: TetriStats-${{ env.VERSION_NAME }}
|
||||
path: renamed_apk/TetriStats-${{ env.VERSION_NAME }}.apk
|
||||
|
||||
- name: Upload APK as artifact for push release
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: TetriStats-${{ env.VERSION_NAME }}-${{ github.run_number }}
|
||||
path: renamed_apk/TetriStats-${{ env.VERSION_NAME }}-${{ github.run_number }}.apk
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
|
@ -53,7 +73,7 @@ jobs:
|
|||
name: Release ${{ env.VERSION_NAME }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: app/build/outputs/apk/release/app-release-unsigned.apk
|
||||
files: renamed_apk/TetriStats-${{ env.VERSION_NAME }}.apk
|
||||
body: |
|
||||
TetriStats Android App Release v${{ env.VERSION_NAME }}
|
||||
|
||||
|
@ -70,7 +90,7 @@ jobs:
|
|||
name: Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: app/build/outputs/apk/release/app-release-unsigned.apk
|
||||
files: renamed_apk/TetriStats-${{ env.VERSION_NAME }}-${{ github.run_number }}.apk
|
||||
body: |
|
||||
TetriStats Android App Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue