diff --git a/Jenkinsfile b/Jenkinsfile index f608703..20be3ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,9 +23,50 @@ pipeline { } } stage('Deploy') { - steps { - echo 'Push to f-droid not yet implemented, archiving instead' - archiveArtifacts artifacts: 'build/app/outputs/apk/release/app-release.apk' + stages { + stage('Checkout F-Droid Repo') { + steps { + dir("fdroid-repo") { + git branch: 'binaries', url: "https://gitlab.julian-mutter.de/julian/fdroid-frajul.git" + } + } + } + + stage('Decrypt keys') { + steps { + dir("fdroid-repo") { + sh './decrypt.sh' + } + } + } + + stage('Copy APK') { + steps { + sh "cp build/app/outputs/apk/release/app-release.apk fdroid-repo/fdroid/repo/sheetless.apk" + } + } + + stage('Update Metadata') { + steps { + dir("fdroid-repo") { + sh './update-repo.sh' + } + } + } + + stage('Push updates') { + steps { + dir("fdroid-repo") { + sh ''' + git checkout master + git add . + git commit -m "Update repo from CI" + git push origin master + ./push-apks.sh + ''' + } + } + } } } }