70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Gradle Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, dev ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- name: Cache Gradle dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: |
|
|
find . -name gradlew -type f -exec chmod +x {} \;
|
|
|
|
- name: Debug Info
|
|
run: |
|
|
echo "Current workspace directory: $GITHUB_WORKSPACE"
|
|
echo "Current directory: $(pwd)"
|
|
echo "Project structure:"
|
|
find . -type f -name "*.kt" | sort
|
|
find . -type f -name "build.gradle*"
|
|
if [ -f ./gradlew ]; then
|
|
./gradlew --version
|
|
else
|
|
echo "No wrapper found, will use system gradle"
|
|
gradle --version
|
|
fi
|
|
|
|
- name: Build CameraApp (CameraApp)
|
|
working-directory: .
|
|
run: |
|
|
echo "Building CameraApp"
|
|
echo "Current directory: $(pwd)"
|
|
./gradlew build
|
|
|
|
- name: Upload CameraApp artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: CameraApp
|
|
path: |
|
|
./build/libs/*.jar
|
|
./app/build/libs/*.jar
|
|
./build/distributions/*.zip
|
|
./app/build/distributions/*.zip
|
|
if-no-files-found: warn
|