Files
neomovies-mobile/.gitlab-ci.yml
factory-droid[bot] 4306a9038a Simplify GitLab CI/CD configuration
- Removed complex before_script logic and manual Flutter installation
- Use ghcr.io/cirruslabs/flutter:stable image for Flutter builds
- Simplified job rules using modern GitLab syntax
- Increased JVM heap to 2048m for better performance
- Removed manual local.properties creation (handled by Gradle)
- Cleaner artifact naming and job structure
- Kept all essential jobs: torrent-engine, apk builds, tests, deploy
2025-10-02 14:01:32 +00:00

107 lines
2.5 KiB
YAML

stages:
- build
- test
- deploy
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs='-Xmx2048m' -Dorg.gradle.parallel=true"
GRADLE_USER_HOME: "${CI_PROJECT_DIR}/.gradle"
PUB_CACHE: "${CI_PROJECT_DIR}/.pub-cache"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .gradle/
- .pub-cache/
- android/.gradle/
- build/
build:torrent-engine:
stage: build
image: mingc/android-build-box:latest
script:
- cd android
- chmod +x gradlew
- ./gradlew :torrentengine:assembleRelease --no-daemon --stacktrace
artifacts:
paths:
- android/torrentengine/build/outputs/aar/*.aar
expire_in: 1 week
rules:
- if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_COMMIT_BRANCH =~ /^feature\//
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
build:apk-debug:
stage: build
image: ghcr.io/cirruslabs/flutter:stable
script:
- flutter pub get
- flutter build apk --debug
artifacts:
paths:
- build/app/outputs/flutter-apk/app-debug.apk
expire_in: 1 week
rules:
- if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_COMMIT_BRANCH =~ /^feature\//
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
allow_failure: true
build:apk-release:
stage: build
image: ghcr.io/cirruslabs/flutter:stable
script:
- flutter pub get
- flutter build apk --release --split-per-abi
artifacts:
paths:
- build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
expire_in: 30 days
rules:
- if: $CI_COMMIT_BRANCH == "dev"
allow_failure: true
test:flutter-analyze:
stage: test
image: ghcr.io/cirruslabs/flutter:stable
script:
- flutter pub get
- flutter analyze
rules:
- if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
allow_failure: true
test:android-lint:
stage: test
image: mingc/android-build-box:latest
script:
- cd android
- chmod +x gradlew
- ./gradlew lint --no-daemon
artifacts:
paths:
- android/app/build/reports/lint-*.html
- android/torrentengine/build/reports/lint-*.html
expire_in: 1 week
when: always
rules:
- if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
allow_failure: true
deploy:release:
stage: deploy
image: alpine:latest
before_script:
- apk add --no-cache curl
script:
- |
if [ -f "build/app/outputs/flutter-apk/app-arm64-v8a-release.apk" ]; then
echo "✅ Release APK ready for deployment"
fi
rules:
- if: $CI_COMMIT_TAG
when: manual