-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
37 lines (33 loc) · 961 Bytes
/
.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
image: gradle:7.2-jdk11
variables:
# Use the value from GitLab variables
MAVEN_USERNAME: ${CI_MAVEN_USERNAME}
MAVEN_PASSWORD: ${CI_MAVEN_PASSWORD}
SIGNING_KEY_ID: ${CI_SIGNING_KEY_ID}
SIGNING_PASSWORD: ${CI_SIGNING_PASSWORD}
SIGNING_KEY: ${CI_SIGNING_KEY}
GIT_STRATEGY: clone
stages:
- build
- publish
# Build stage
build:
stage: build
script:
- cp secret.properties.sample secret.properties
- gradle build
# Publish stage
publish:
stage: publish
script:
- echo "Publishing to Maven repository"
- echo "ossrhUsername=$MAVEN_USERNAME" >> secret.properties
- echo "ossrhPassword=$MAVEN_PASSWORD" >> secret.properties
- echo "signing.keyId=$SIGNING_KEY_ID" >> secret.properties
- echo "signing.password=$SIGNING_PASSWORD" >> secret.properties
- echo "signing.secretKey=$SIGNING_KEY" >> secret.properties
- gradle publishJvmPublicationToMavenRepository
dependencies:
- build
only:
- main