Skip to content

Commit

Permalink
Introduce github apk publish job [VPNAND-93]
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-markowicz committed Jun 12, 2020
1 parent 0637f34 commit e05dfa6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
31 changes: 30 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ build blue:

build release:
stage: build
except:
- master
tags:
- android
script:
Expand All @@ -120,6 +122,21 @@ build release:
paths:
- app/build/outputs/apk

build release (auto):
stage: build
only:
refs:
- master
tags:
- android
script:
- ./gradlew openvpn:assemble
- ./gradlew assembleProdRelease -PabiSplit -PbuildUniversalApk
artifacts:
expire_in: 3 week
paths:
- app/build/outputs/apk

unit tests:
stage: test
tags:
Expand Down Expand Up @@ -215,7 +232,6 @@ sync-app:
stage: mirror
only:
refs:
- tags
- master

script:
Expand Down Expand Up @@ -246,6 +262,10 @@ include:
ref: master
file: '/jobs/commit-locales.gitlab-ci.yml'

- project: 'agarroux/publish-github'
ref: master
file: '/jobs/release.gitlab-ci.yml'

i18n-sync-crowdin:
variables:
I18N_SYNC_BRANCH: development
Expand All @@ -258,3 +278,12 @@ i18n-commit-locales:
I18N_COMMIT_BRANCH_ALLOWED: development
I18N_COMMIT_CROWDIN_PROJECT: 'android-vpn'
extends: .i18n-commit-locales-shared

publish-github:
only:
refs:
- master
variables:
RELEASE_APP: android-vpn
RELEASE_GITHUB_REPOSITORY: $PUBLIC_REPO_URL
extends: .release-make-release
8 changes: 3 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,9 @@ class Helpers {
def dev = tagSplit.size() > 2 ? tagSplit[2] : 0
def release = tagSplit.size() > 3 ? tagSplit[3] : 0

if (exec("git rev-parse --verify origin/development", false) == null) {
// no development branch, e.g. public repository, just add #commits since the last tag
// to R part
release += exec("git rev-list --count ${tag}..HEAD").trim().toInteger()
} else {
// On master or public repo just use last tag for version name
if (exec("git rev-parse --abbrev-ref HEAD").trim() != "master"
&& exec("git rev-parse --verify origin/development", false) != null) {
def branchPoint = exec("git merge-base origin/development HEAD").trim()
// add #commits from tag to branch point with development to dev
dev += exec("git rev-list --count ${tag}..${branchPoint}").trim().toInteger()
Expand Down

0 comments on commit e05dfa6

Please sign in to comment.