diff --git a/.ci/prepare-publish.sh b/.ci/prepare-publish.sh new file mode 100755 index 000000000..0236b4ce1 --- /dev/null +++ b/.ci/prepare-publish.sh @@ -0,0 +1,14 @@ +#!/bin/sh +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./" "{}" \; +# workaround for bug in fdroid nightly +sed -i "s/-debug.apk/-unsigned.apk/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py +# generate new version +git fetch --tags +export versionCode="$DRONE_BUILD_NUMBER" +export versionName="$(git describe --tag --abbrev=0)-${DRONE_BUILD_NUMBER}" +echo "set VersionCode '${versionCode}' and VersonName '${versionName}'" +sed -i "s/^\(\s*versionCode\s*\).*$/\1$versionCode/" build.gradle +sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle +cat -n build.gradle diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..7aa749fe2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- image: registry.gitlab.com/fdroid/ci-images-client:latest + name: build + when: + branch: + exclude: + - droneci + commands: + - ./gradlew assembleConversationsFreeCompatDebug + +- image: registry.gitlab.com/fdroid/ci-images-client:latest + name: publish + when: + branch: + include: + - droneci + environment: + DEBUG_KEYSTORE: + from_secret: DEBUG_KEYSTORE + commands: + - .ci/prepare-publish.sh + # build free version + - ./gradlew assembleConversationsFreeCompatRelease + - ls build/outputs/apk/conversationsFreeCompat/* + # publish on nightly fdroid repo + - fdroid nightly -v