Skip to content

Commit

Permalink
Push android version code back to github master
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteriumTeam committed Mar 3, 2020
1 parent 370271b commit d0d8a26
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
9 changes: 8 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ buildDebug:
stage: build
except: [tags]
tags: [docker]
except:
changes:
- "./fastlane/android_version_code"
script:
- bundle exec fastlane buildDebug

Expand All @@ -17,6 +20,9 @@ testDebug:
stage: test
except: [tags]
tags: [docker]
except:
changes:
- "./fastlane/android_version_code"
dependencies:
- buildDebug
script:
Expand All @@ -36,4 +42,5 @@ publishInternal:
script:
- bundle exec fastlane bumpAndroidVersionCode
- bundle exec fastlane internal
- bundle exec fastlane pushAndroidVersionCode
- ./push_version_code.sh

13 changes: 0 additions & 13 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fastlane/android_version_code
Original file line number Diff line number Diff line change
@@ -1 +1 @@
107044
107045
24 changes: 24 additions & 0 deletions push_version_code.sh
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
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

0 comments on commit d0d8a26

Please sign in to comment.