Skip to content

reverted to working version of workflow. workflow build #37

reverted to working version of workflow. workflow build

reverted to working version of workflow. workflow build #37

name: Build Dev APK
on:
push:
branches:
- '**'
permissions:
contents: write
jobs:
Gradle:
if: endsWith(github.event.head_commit.message, 'workflow build') && github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Ensure Gradle wrapper exists
run: |
if [ ! -f "gradlew" ]; then
echo "Gradle wrapper missing, generating..."
wget https://services.gradle.org/distributions/gradle-9.4.1-bin.zip
unzip -q gradle-9.4.1-bin.zip
./gradle-9.4.1/bin/gradle wrapper --gradle-version 9.4.1
else
echo "Gradle wrapper already exists"
fi
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build Release APK
run: ./gradlew assembleRelease
- name: Prepare beta builds folder
run: |
rm -rf beta-builds
mkdir -p beta-builds
# UPDATED STEP: Uses find to locate the APK even if it's in a subdirectory
- name: Find and Copy APK
run: |
find app/build/outputs/apk/release -name "*.apk" -exec cp {} beta-builds/app-release.apk \;
- name: Commit APK
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add beta-builds/app-release.apk
git commit -m "create beta build APK" || echo "No changes to commit"
git push