-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
64 lines (57 loc) · 1.44 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
64 lines (57 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
image: openjdk:11-jdk
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- .gradle-cache/caches/
- .gradle-cache/notifications/
- .gradle-cache/wrapper/
policy: pull
workflow:
rules:
- if: '$CI_COMMIT_MESSAGE =~ /^chore\(release\):/ && $CI_COMMIT_BRANCH == "master"'
when: never
- when: always
stages:
- build
- publish
- release
build-modules:
stage: build
dependencies: [ ]
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- .gradle-cache/caches/
- .gradle-cache/notifications/
- .gradle-cache/wrapper/
policy: pull-push
script: |
./gradlew --build-cache --gradle-user-home .gradle-cache/ clean build
publish-modules:
stage: publish
dependencies: [ ]
script: |
./gradlew --build-cache --gradle-user-home .gradle-cache/ publish
rules:
- if: '$CI_COMMIT_TAG'
release-version:
stage: release
dependencies: [ ]
variables:
GRGIT_USER: GitLab
GRGIT_PASS: "${RELEASE_TOKEN}"
script: |
git config user.name "GitLab"
git config user.email gitlab@nortal.com
./gradlew --build-cache --gradle-user-home .gradle-cache/ release -Prelease.ignoreUncommittedChanges=true --stacktrace
git push "https://$GRGIT_USER:$GRGIT_PASS@${CI_REPOSITORY_URL#*@}" --tags
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
- when: never