Skip to content

Commit

Permalink
chore: 👷 add and update CI build system
Browse files Browse the repository at this point in the history
  • Loading branch information
samiurprapon committed Sep 22, 2024
1 parent a90575e commit a8932d1
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand All @@ -22,13 +24,29 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'

- name: Change directory
run: cd android

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Diagnose project structure
run: |
echo "Current directory:"
pwd
echo "Directory contents:"
ls -R
echo "Searching for gradlew:"
find . -name gradlew
- name: Set Gradle Wrapper Permissions
run: |
GRADLEW_PATH=$(find . -name gradlew | head -n 1)
if [ -z "$GRADLEW_PATH" ]; then
echo "gradlew not found. Exiting."
exit 1
fi
chmod +x $GRADLEW_PATH
echo "GRADLEW_PATH=$GRADLEW_PATH" >> $GITHUB_ENV
- name: Cache Gradle packages
uses: actions/cache@v3
with:
Expand All @@ -39,20 +57,17 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Build gradle project
run: ./gradlew build
run: ${{ env.GRADLEW_PATH }} build

- name: Build debug APK
run: ./gradlew assembleDebug
run: ${{ env.GRADLEW_PATH }} assembleDebug

- name: Upload debug APK
uses: actions/upload-artifact@v3
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
path: '**/build/outputs/apk/debug/*.apk'

# release:
# needs: build
Expand Down

0 comments on commit a8932d1

Please sign in to comment.