diff options
author | genofire <geno+dev@fireorbit.de> | 2019-06-22 17:33:32 +0200 |
---|---|---|
committer | Christian Schneppe <kriztan@users.noreply.github.com> | 2019-06-22 17:33:32 +0200 |
commit | 4726fcfd465b4f5fda52899423275efbd5d70498 (patch) | |
tree | 2b22229d0d77c0530b94330f594ffd185830f30c | |
parent | e3603f7c41ebef326d684bdd5883af5926d8bf28 (diff) |
fix gitlab-ci build (#355)
-rw-r--r-- | .gitlab-ci.yml | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0c9d8702..ca171dde6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,11 +4,9 @@ cache: paths: - .gradle/wrapper - .gradle/caches - - .android stages: - build - - test before_script: - export GRADLE_USER_HOME=$PWD/.gradle @@ -18,29 +16,40 @@ before_script: build: stage: build + #except: + #- master script: # generate version number - - export versionCode=`printf $(git rev-list --first-parent --count HEAD)` - - export versionName=`printf '%s-%05d' $(git describe --tag --abbrev=0) $versionCode` + - export versionCode="$CI_JOB_ID" + - export versionName="$(git describe --tag --abbrev=0)-${CI_JOB_ID}_${CI_COMMIT_REF_NAME}" - echo "set VersionCode '${versionCode}' and VersonName '${versionName}'" - sed -i "s/^\(\s*versionCode\s*\).*$/\1$versionCode/" build.gradle - sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle - - cat -n build.gradle # build - ./gradlew assembleStandard - # publish on nightly fdroid repo - - fdroid nightly artifacts: paths: - - build/outputs/ + - build/outputs/apk/standard -test: - stage: test +publish: + stage: build + only: + #- master + - master--not-build-on-my-repo script: - - ./gradlew lint + # generate version number + - export versionCode="$CI_JOB_ID" + - export versionName="$(git describe --tag --abbrev=0)-${CI_JOB_ID}_${CI_COMMIT_REF_NAME}" + - echo "set VersionCode '${versionCode}' and VersonName '${versionName}'" + - sed -i "s/^\(\s*versionCode\s*\).*$/\1$versionCode/" build.gradle + - sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle + # build + - ./gradlew assembleStandard + # publish on nightly fdroid repo + - fdroid nightly -v artifacts: paths: - - build/outputs/ + - build/outputs/apk/standard after_script: # this file changes every time but should not be cached |