4
4
push :
5
5
branches :
6
6
- master
7
+ - axon-kotlin-*.*.x
7
8
pull_request :
8
9
9
10
jobs :
@@ -15,64 +16,78 @@ jobs:
15
16
strategy :
16
17
matrix :
17
18
include :
18
- - java-version : 8
19
- sonar-enabled : false
20
- - java-version : 11
21
- sonar-enabled : true
19
+ - java-version : 8
20
+ sonar-enabled : false
21
+ deploy : true
22
+ - java-version : 11
23
+ sonar-enabled : true
24
+ deploy : false
22
25
23
26
steps :
24
- - name : Checkout code
25
- uses : actions/checkout@v2
27
+ - name : Checkout code
28
+ uses : actions/checkout@v2
26
29
27
- - name : Set up JDK ${{ matrix.java-version }}
28
- uses : actions/setup-java@v1.4.3
29
- with :
30
- java-version : ${{ matrix.java-version }}
30
+ - name : Set up JDK ${{ matrix.java-version }}
31
+ uses : actions/setup-java@v1.4.3
32
+ with :
33
+ java-version : ${{ matrix.java-version }}
34
+ server-id : sonatype
35
+ server-username : MAVEN_USERNAME
36
+ server-password : MAVEN_PASSWORD
31
37
32
- - name : Cache .m2
33
- uses : actions/cache@v2.1.3
34
- with :
35
- path : ~/.m2/repository
36
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
37
- restore-keys : |
38
- ${{ runner.os }}-maven
38
+ - name : Cache .m2
39
+ uses : actions/cache@v2.1.3
40
+ with :
41
+ path : ~/.m2/repository
42
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
43
+ restore-keys : |
44
+ ${{ runner.os }}-maven
39
45
40
- - name : Maven operation with Sonar
41
- if : matrix.sonar-enabled
42
- run : |
43
- mvn -B -U -Pcoverage \
44
- clean verify \
45
- sonar:sonar \
46
- -Dsonar.projectKey=AxonFramework_extension-reactor \
47
- -Dsonar.organization=axonframework \
48
- -Dsonar.host.url=https://sonarcloud.io \
49
- -Dsonar.login=${{ secrets.SONAR_TOKEN }}
50
- env :
51
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
+ - name : Maven operation with Sonar
47
+ if : matrix.sonar-enabled
48
+ run : |
49
+ mvn -B -U -Pcoverage \
50
+ clean verify \
51
+ sonar:sonar \
52
+ -Dsonar.projectKey=AxonFramework_extension-reactor \
53
+ -Dsonar.organization=axonframework \
54
+ -Dsonar.host.url=https://sonarcloud.io \
55
+ -Dsonar.login=${{ secrets.SONAR_TOKEN }}
56
+ env :
57
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
58
53
- - name : Maven operation without Sonar
54
- if : matrix.sonar-enabled != true
55
- run : |
56
- mvn -B -U clean verify
57
- env :
58
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
+ - name : Maven operation without Sonar
60
+ if : matrix.sonar-enabled != true
61
+ run : |
62
+ mvn -B -U clean verify
63
+ env :
64
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
65
60
- - name : Notify success to Slack
61
- if : success()
62
- env :
63
- SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
64
- uses : voxmedia/github-action-slack-notify-build@v1.1.2
65
- with :
66
- channel_id : CAGSEC92A
67
- status : SUCCESS
68
- color : good
66
+ - name : Deploy to Sonatype
67
+ if : github.github.head_ref == null && success() && matrix.deploy
68
+ run : |
69
+ ./mvnw -B -U deploy -DskipTests=true
70
+ env :
71
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72
+ MAVEN_USERNAME : ${{ secrets.SONATYPE_TOKEN_ID }}
73
+ MAVEN_PASSWORD : ${{ secrets.SONATYPE_TOKEN_PASS }}
69
74
70
- - name : Notify failure to Slack
71
- if : failure()
72
- env :
73
- SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
74
- uses : voxmedia/github-action-slack-notify-build@v1.1.2
75
- with :
76
- channel_id : CAGSEC92A
77
- status : FAILED
78
- color : danger
75
+ - name : Notify success to Slack
76
+ if : success()
77
+ env :
78
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
79
+ uses : voxmedia/github-action-slack-notify-build@v1.1.2
80
+ with :
81
+ channel_id : CAGSEC92A
82
+ status : SUCCESS
83
+ color : good
84
+
85
+ - name : Notify failure to Slack
86
+ if : failure()
87
+ env :
88
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
89
+ uses : voxmedia/github-action-slack-notify-build@v1.1.2
90
+ with :
91
+ channel_id : CAGSEC92A
92
+ status : FAILED
93
+ color : danger
0 commit comments