From d60b4b2d744c1e5fc334efb6ad2698adc2333ad7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 20 May 2020 19:33:36 +0000 Subject: [PATCH] Add upload to fdroid repo CI task --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bef17a5..e3a564c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,6 +73,34 @@ build_android_appbundle: only: - master +upload_to_fdroid_repo: + stage: publish + before_script: + ## + ## Install ssh-agent if not already installed. + ## + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + ## + ## Install rsync if not already installed. + ## + - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' + ## + ## Run ssh-agent (inside the build environment) + ## + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + script: + - export UPDATE_VERSION=$(pcregrep -o1 'version:\\s([0-9]*\\.[0-9]*\\.[0-9]*)\\+[0-9]*' pubspec.yaml) + - mv app-release.apk "${UPDATE_VERSION}.apk" + - cd build/app/outputs/apk/release/ && rsync -rav -e ssh ./ fluffy@fdroid.nordgedanken.dev:/fdroid/repo + - ssh fluffy@fdroid.nordgedanken.dev "cd fdroid && fdroid update" + dependencies: + - build_android_apk + only: + - tags + pages: stage: publish image: ruby:2.3