From d0d8a266fcde31c29f37ee7626a5ee28d1cdabce Mon Sep 17 00:00:00 2001 From: Mysterium Team Date: Tue, 3 Mar 2020 11:11:55 +0200 Subject: [PATCH] Push android version code back to github master --- .gitlab-ci.yml | 9 ++++++++- fastlane/Fastfile | 13 ------------- fastlane/android_version_code | 2 +- push_version_code.sh | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100755 push_version_code.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8170d5639..9d2187a56 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,9 @@ buildDebug: stage: build except: [tags] tags: [docker] + except: + changes: + - "./fastlane/android_version_code" script: - bundle exec fastlane buildDebug @@ -17,6 +20,9 @@ testDebug: stage: test except: [tags] tags: [docker] + except: + changes: + - "./fastlane/android_version_code" dependencies: - buildDebug script: @@ -36,4 +42,5 @@ publishInternal: script: - bundle exec fastlane bumpAndroidVersionCode - bundle exec fastlane internal - - bundle exec fastlane pushAndroidVersionCode + - ./push_version_code.sh + diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f5535c999..fd22dd115 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -59,19 +59,6 @@ platform :android do lane :bumpAndroidVersionCode do increase_version_code end - - desc "Commit and push bumped version" - lane :pushAndroidVersionCode do - git_commit(path: "./fastlane/android_version_code", message: "Bump Android version code") - - push_to_git_remote( - remote: "origin", - remote_branch: "master", - no_verify: true, - tags: false, - set_upstream: true - ) - end end def increase_version_code diff --git a/fastlane/android_version_code b/fastlane/android_version_code index 137e8c06c..300a70645 100644 --- a/fastlane/android_version_code +++ b/fastlane/android_version_code @@ -1 +1 @@ -107044 \ No newline at end of file +107045 diff --git a/push_version_code.sh b/push_version_code.sh new file mode 100755 index 000000000..34801b45a --- /dev/null +++ b/push_version_code.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# This script adds github as remote when running from gitlab CI and +# pushes bumped android version code to github master. + +setup_git() { + git config user.email "core-services@mysterium.network" + git config user.name "Mysterium Team" +} + +commit_version_code() { + git checkout -b bump-version + git add ./fastlane/android_version_code + git commit --message "Test Bump Android version code" +} + +upload_files() { + git remote add github https://${GITHUB_MOBILE_API_TOKEN}@github.com/mysteriumnetwork/mysterium-vpn-mobile.git > /dev/null 2>&1 + git push --set-upstream github HEAD:master +} + +setup_git +commit_version_code +upload_files