-
Notifications
You must be signed in to change notification settings - Fork 28
/
.gitlab-ci.yml
24 lines (24 loc) · 1 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
job:
before_script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_LOGIN}"
script:
- git fetch
- var=$(git describe --tags)
- version=${var:1}
- exists=$(git ls-remote --heads origin fdroid)
- if [[ -n $exists ]]; then
- git push "https://${GITLAB_USER_LOGIN}:${PERSONAL_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" --delete fdroid
- fi
- git checkout -b fdroid
- sed -i "s#versionCode appVersionCode#versionCode $version#" app/build.gradle
- sed -i "s#versionName appVersionName#versionName \"$version\"#" app/build.gradle
- git add app/build.gradle
- git commit -m "update to $version"
- git push "https://${GITLAB_USER_LOGIN}:${PERSONAL_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}"
- git tag "fdroid-$version"
- git push --tag "https://${GITLAB_USER_LOGIN}:${PERSONAL_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}"
- cat app/build.gradle | grep $version
only:
variables:
- $CI_COMMIT_TAG =~ /^v.*$/