File tree Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish to Maven Central
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+
13
+ - name : Set up JDK 1.8
14
+ uses : actions/setup-java@v1
15
+ with :
16
+ java-version : 1.8
17
+
18
+ - name : Cache local Maven repository
19
+ uses : actions/cache@v2
20
+ with :
21
+ path : ~/.m2/repository
22
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
23
+ restore-keys : |
24
+ ${{ runner.os }}-maven-
25
+ - id : install-secret-key
26
+ name : Install GPG secret key
27
+ run : |
28
+ cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
29
+ - name : Deploy
30
+ run : |
31
+ mvn -P gpg_verify \
32
+ --no-transfer-progress \
33
+ --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
34
+ --file pom.xml -s release/m2-settings.xml verify deploy
35
+ env :
36
+ OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
37
+ OSSRH_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
Original file line number Diff line number Diff line change 53
53
</dependency >
54
54
</dependencies >
55
55
56
+ <distributionManagement >
57
+ <snapshotRepository >
58
+ <id >ossrh</id >
59
+ <url >https://oss.sonatype.org/content/repositories/snapshots</url >
60
+ </snapshotRepository >
61
+ </distributionManagement >
62
+
56
63
<build >
57
64
<plugins >
58
65
<plugin >
76
83
<artifactId >maven-surefire-plugin</artifactId >
77
84
<version >2.22.1</version >
78
85
</plugin >
86
+ <plugin >
87
+ <groupId >org.sonatype.plugins</groupId >
88
+ <artifactId >nexus-staging-maven-plugin</artifactId >
89
+ <version >1.6.7</version >
90
+ <extensions >true</extensions >
91
+ <configuration >
92
+ <serverId >ossrh</serverId >
93
+ <nexusUrl >https://oss.sonatype.org/</nexusUrl >
94
+ <autoReleaseAfterClose >true</autoReleaseAfterClose >
95
+ </configuration >
96
+ </plugin >
79
97
</plugins >
80
98
</build >
81
99
136
154
</license >
137
155
</licenses >
138
156
139
- </project >
157
+ </project >
Original file line number Diff line number Diff line change
1
+ <settings >
2
+ <servers >
3
+ <server >
4
+ <id >ossrh</id >
5
+ <username >${env.OSSRH_USERNAME}</username >
6
+ <password >${env.OSSRH_PASSWORD}</password >
7
+ </server >
8
+ </servers >
9
+ </settings >
You can’t perform that action at this time.
0 commit comments