diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9a738afc..49e0d3748 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,6 +109,8 @@ build blue: build release: stage: build + except: + - master tags: - android script: @@ -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: @@ -215,7 +232,6 @@ sync-app: stage: mirror only: refs: - - tags - master script: @@ -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 @@ -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 diff --git a/app/build.gradle b/app/build.gradle index cf7cc4e04..994d068c4 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -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()