-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
71 lines (65 loc) · 1.44 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
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
65
66
67
68
69
70
71
image: gradle:latest
cache: &global_cache
# per-branch cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- .gradle/
# make push explicit
policy: pull
build:
stage: build
script:
- gradle assemble --build-cache
artifacts:
paths:
- build/
cache:
<<: *global_cache
policy: pull-push
test:
stage: test
script:
- gradle check
artifacts:
paths:
- build/reports/
when: always
deliver-internal:
stage: deploy
when: manual
# use only artifacts from build job
dependencies:
- build
script:
- gradle publishAllPublicationsToGitlabRepository
publishNodeJsNpmPublicationToGitlab
# Expected environment variables (required to publish)
# - OSSRH_USERNAME, OSSRH_TOKEN: MavenCentral credentials
# - GPG_SECRET_KEY: ASCII-armored GPG private signing key
# - GPG_KEY_ID: 8-characters GPG key ID
# - GPG_PASSPHRASE: GPG key passphrase
# - NPMJS_AUTH_TOKEN: NPMjs credentials
publish:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: manual
# use only artifacts from build job
dependencies:
- build
script:
- gradle publishAllPublicationsToMavenCentralRepository
publishNodeJsNpmPublicationToNpmjs
pages:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
# use only artifacts from build job
dependencies:
- build
script:
- gradle dokkaHtml
- mv build/dokka/html public
artifacts:
paths:
- public