1
1
version : 2.1
2
2
3
- executors :
4
- maven-executor :
5
- docker :
6
- - image : circleci/openjdk:8u171-jdk
3
+ orbs :
4
+ github-maven-deploy : github-maven-deploy/github-maven-deploy@dev:22
7
5
8
- jobs :
6
+ mvn-build-test-command : &mvn-build-test-command
7
+ mvn-build-test-command : mvn verify -DexcludeLiveServerTests=true
9
8
10
- build-and-test :
11
- executor : maven-executor
12
-
13
- steps :
14
- - checkout
15
- - restore_cache :
16
- key : simple-java-mail-{{ checksum ".circleci/config.yml" }}
17
- - run :
18
- command : mvn verify -DexcludeLiveServerTests=true
19
- - save_cache :
20
- paths :
21
- - ~/.m2
22
- key : simple-java-mail-{{ checksum ".circleci/config.yml" }}
23
- - persist_to_workspace :
24
- root : .
25
- paths :
26
- - .
27
- - run :
28
- shell : /bin/bash -eo pipefail -O globstar
29
- command : |
30
- mkdir -p artifacts/cli artifacts/coverage artifacts/junit artifacts/javadoc
31
- cp **/target/*.jar artifacts/
32
- cp modules/cli-module/target/*standalone* artifacts/cli/
33
- cp -a target/apidocs/. artifacts/javadoc/
34
- cp -a modules/jacoco-aggregator-module/target/site/jacoco-aggregate/. artifacts/coverage/
35
- cp -a **/target/surefire-reports/. artifacts/junit
36
- - store_artifacts :
37
- path : artifacts
38
- - store_test_results :
39
- path : artifacts/junit
40
-
41
- deploy-patch-version :
42
- executor : maven-executor
43
- steps :
44
- - deploy :
45
- versioncommand : mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit
46
-
47
- deploy-minor-version :
48
- executor : maven-executor
49
- steps :
50
- - deploy :
51
- versioncommand : mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} versions:commit
52
-
53
- deploy-major-version :
54
- executor : maven-executor
55
- steps :
56
- - deploy :
57
- versioncommand : mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.nextMajorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} versions:commit
58
-
59
-
60
- commands :
61
- deploy :
62
- parameters :
63
- versioncommand :
64
- type : string
65
- steps :
66
- - attach_workspace :
67
- at : .
68
- - restore_cache :
69
- key : simple-java-mail-{{ checksum ".circleci/config.yml" }}
70
- - run :
71
- command : |
72
- echo "Starting new release..."
73
- << parameters.versioncommand >>
74
- MVN_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
75
- echo "Releasing version ${MVN_VERSION}..."
76
- # mvn -s .circleci/maven-release-settings.xml clean deploy nexus-staging:release -DdeployAtEnd=true -DperformRelease=true -DskipTests
77
- mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
78
- # git commit -am "released ${MVN_VERSION}" && git push
79
- echo "Succesfully released ${MVN_VERSION}"
9
+ mvn-collect-artifacts-command : &mvn-collect-artifacts-command
10
+ mvn-collect-artifacts-command : |
11
+ mkdir -p artifacts/cli artifacts/coverage artifacts/junit artifacts/javadoc
12
+ cp **/target/*.jar artifacts/
13
+ cp modules/cli-module/target/*standalone* artifacts/cli/
14
+ cp -a target/apidocs/. artifacts/javadoc/
15
+ cp -a modules/jacoco-aggregator-module/target/site/jacoco-aggregate/. artifacts/coverage/
16
+ cp -a **/target/surefire-reports/. artifacts/junit
80
17
18
+ mvn-deploy-command : &mvn-deploy-command
19
+ mvn-deploy-command : mvn -s .circleci/maven-release-settings.xml clean deploy -DdeployAtEnd=true -DperformRelease=true -DskipTests -Dspotbugs.skip=true
20
+ context : RELEASE_PROFILE_BBOTTEMA
81
21
82
22
workflows :
83
23
workflow :
84
24
jobs :
85
- - build-and-test
86
- - approve-deploy-patch-version :
25
+ - github-maven-deploy/build-and-test :
26
+ << : *mvn-build-test-command
27
+ << : *mvn-collect-artifacts-command
28
+ filters :
29
+ branches :
30
+ only : master
31
+
32
+ - github-maven-deploy/approve-deploy-patch-version :
87
33
type : approval
88
34
requires :
89
- - build-and-test
90
- - approve-deploy-minor-version :
35
+ - github-maven-deploy/ build-and-test
36
+ - github-maven-deploy/ approve-deploy-minor-version :
91
37
type : approval
92
38
requires :
93
- - build-and-test
94
- - approve-deploy-major-version :
39
+ - github-maven-deploy/ build-and-test
40
+ - github-maven-deploy/ approve-deploy-major-version :
95
41
type : approval
96
42
requires :
97
- - build-and-test
98
- - deploy-patch-version :
43
+ - github-maven-deploy/build-and-test
44
+
45
+ - github-maven-deploy/deploy-patch-version :
99
46
requires :
100
- - approve-deploy-patch-version
101
- - deploy-minor-version :
47
+ - github-maven-deploy/approve-deploy-patch-version
48
+ << : *mvn-deploy-command
49
+ - github-maven-deploy/deploy-minor-version :
102
50
requires :
103
- - approve-deploy-minor-version
104
- - deploy-major-version :
51
+ - github-maven-deploy/approve-deploy-minor-version
52
+ << : *mvn-deploy-command
53
+ - github-maven-deploy/deploy-major-version :
105
54
requires :
106
- - approve-deploy-major-version
55
+ - github-maven-deploy/approve-deploy-major-version
56
+ << : *mvn-deploy-command
0 commit comments