mirror of
https://github.com/cmclark00/TetriStats.git
synced 2025-05-17 22:55:21 +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
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x 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
|
- name: Get version name from build.gradle
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION_NAME=$(grep -o 'versionName = "[^"]*' app/build.gradle.kts | cut -d'"' -f2)
|
VERSION_NAME=$(grep -o 'versionName = "[^"]*' app/build.gradle.kts | cut -d'"' -f2)
|
||||||
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
||||||
echo "APP_VERSION=$VERSION_NAME" >> $GITHUB_OUTPUT
|
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
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
@ -53,7 +73,7 @@ jobs:
|
||||||
name: Release ${{ env.VERSION_NAME }}
|
name: Release ${{ env.VERSION_NAME }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: app/build/outputs/apk/release/app-release-unsigned.apk
|
files: renamed_apk/TetriStats-${{ env.VERSION_NAME }}.apk
|
||||||
body: |
|
body: |
|
||||||
TetriStats Android App Release v${{ env.VERSION_NAME }}
|
TetriStats Android App Release v${{ env.VERSION_NAME }}
|
||||||
|
|
||||||
|
@ -70,7 +90,7 @@ jobs:
|
||||||
name: Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
name: Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: 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: |
|
body: |
|
||||||
TetriStats Android App Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
TetriStats Android App Release v${{ env.VERSION_NAME }}-${{ github.run_number }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue