Verified Commit fe848992 authored by genofire's avatar genofire Committed by genofire
Browse files

easy gitlab-ci with fdroid nightly support

Update .gitlab-ci
parent c7f1b572
Pipeline #1823 failed with stage
in 13 seconds
image: registry.gitlab.com/fdroid/ci-images-client:latest
cache:
paths:
- .gradle/wrapper
- .gradle/caches
stages:
- build
before_script:
- apt-get -qy install gradle
- export GRADLE_USER_HOME=$PWD/.gradle
- export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
- echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
build:
stage: build
except:
- develop
script:
- ./gradlew
artifacts:
paths:
- build/outputs/
publish:
stage: build
only:
- develop
script:
# generate new version
- export versionCode="$CI_JOB_ID"
- export versionName="$(git describe --tag --abbrev=0)-${CI_JOB_ID}_${CI_COMMIT_REF_NAME}"
- echo "set VersionCode '${versionCode}' and VersonName '${versionName}'"
- sed -i "s/^\(\s*versionCode\s*\).*$/\1$versionCode/" app/build.gradle
- sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" app/build.gradle
- cat -n app/build.gradle
# build free version
- ./gradlew
# publish on nightly fdroid repo
- fdroid nightly -v
after_script:
# this file changes every time but should not be cached
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
- rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment