2018-11-09 15:13:53 +01:00
|
|
|
image: registry.gitlab.com/fdroid/ci-images-client:latest
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .gradle/wrapper
|
|
|
|
- .gradle/caches
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- export GRADLE_USER_HOME=$PWD/.gradle
|
|
|
|
- export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle`
|
|
|
|
- echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
except:
|
|
|
|
- develop
|
|
|
|
script:
|
|
|
|
- ./gradlew assembleConversationsFreeCompatDebug
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- build/outputs/
|
|
|
|
|
|
|
|
publish:
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
script:
|
2019-05-07 16:07:53 +02:00
|
|
|
- find -type d -name "siacs" -print0 | xargs --null -I{} bash -c 'x="{}"; mv "$x" "${x/siacs/sum7}" '
|
|
|
|
- find -type f -name "*.java" -exec sed -i "/eu.siacs.conversations.axolotl/! s/eu.siacs./eu.sum7./" "{}" \;
|
|
|
|
- find -type f -name "*.xml" -exec sed -i "/eu.siacs.conversations.axolotl/! s/eu.siacs./eu.sum7./" "{}" \;
|
2018-11-09 15:13:53 +01:00
|
|
|
# workaround for bug in fdroid nightly
|
2019-04-19 18:01:58 +02:00
|
|
|
- sed -i "s/-debug.apk/-unsigned.apk/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
|
2018-11-09 15:13:53 +01:00
|
|
|
- sed -i "s/servergitmirror = 'git@' +/servergitmirror = 'gitlab@' +/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
|
|
|
|
- sed -i "s/git@/gitlab@/" /usr/lib/python3/dist-packages/fdroidserver/index.py
|
|
|
|
# generate new version
|
2019-04-19 18:01:58 +02:00
|
|
|
- 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/" build.gradle
|
2018-11-09 15:13:53 +01:00
|
|
|
- sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle
|
|
|
|
- cat -n build.gradle
|
|
|
|
# build free version
|
2019-04-19 18:01:58 +02:00
|
|
|
- ./gradlew assembleConversationsFreeCompatRelease
|
|
|
|
- ls build/outputs/apk/conversationsFreeCompat/*
|
2018-11-09 15:13:53 +01:00
|
|
|
# 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/
|