-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
52 lines (47 loc) · 1.33 KB
/
.gitlab-ci.yml
File metadata and controls
52 lines (47 loc) · 1.33 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
image: maven:3.9.9-eclipse-temurin-17
stages:
- verify
- release
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode --no-transfer-progress --errors"
cache:
key: "${CI_PROJECT_ID}"
paths:
- .m2/repository
verify:
stage: verify
script:
- mvn ${MAVEN_CLI_OPTS} -Dgpg.skip=true clean verify
artifacts:
when: always
expire_in: 7 days
paths:
- target/
rules:
- if: $CI_COMMIT_TAG
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH
release-central:
stage: release
before_script:
- mkdir -p ~/.m2
- |
cat > ~/.m2/settings.xml <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<servers>
<server>
<id>central</id>
<username>${CENTRAL_USERNAME}</username>
<password>${CENTRAL_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
- echo "$GPG_PRIVATE_KEY" | gpg --batch --import
script:
- mvn ${MAVEN_CLI_OPTS} -Dgpg.passphrase="$GPG_PASSPHRASE" clean deploy
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+(-.*)?$/'