improve gitlab-ci version naming + deploy releasefile

This commit is contained in:
Martin/Geno 2019-04-19 18:01:58 +02:00
parent db8160e681
commit 25c2ed38d8
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 7 additions and 4 deletions

View File

@ -29,16 +29,19 @@ publish:
- develop - develop
script: script:
# workaround for bug in fdroid nightly # workaround for bug in fdroid nightly
- sed -i "s/-debug.apk/-unsigned.apk/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
- sed -i "s/servergitmirror = 'git@' +/servergitmirror = 'gitlab@' +/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py - sed -i "s/servergitmirror = 'git@' +/servergitmirror = 'gitlab@' +/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
- sed -i "s/git@/gitlab@/" /usr/lib/python3/dist-packages/fdroidserver/index.py - sed -i "s/git@/gitlab@/" /usr/lib/python3/dist-packages/fdroidserver/index.py
# generate new version # generate new version
- export versionCode=`printf '%05d' $(date '+%s'| cut -b4-8)` - export versionCode="$CI_JOB_ID"
- sed -i "s/^\(\s*versionCode\s*[0-9]*\).*/\1$versionCode/" build.gradle - export versionName="$(git describe --tag --abbrev=0)-${CI_JOB_ID}_${CI_COMMIT_REF_NAME}"
- export versionName=`printf '%s-%05d' $(git describe --tag --abbrev=0) $versionCode` - 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 - sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle
- cat -n build.gradle - cat -n build.gradle
# build free version # build free version
- ./gradlew assembleConversationsFreeCompatDebug - ./gradlew assembleConversationsFreeCompatRelease
- ls build/outputs/apk/conversationsFreeCompat/*
# publish on nightly fdroid repo # publish on nightly fdroid repo
- fdroid nightly -v - fdroid nightly -v