Skip to content

Commit d78fe9f

Browse files
Updates workflows (#48)
* Updates github/maven central release workflows * Delete trailing whitespace
1 parent 763769a commit d78fe9f

File tree

2 files changed

+52
-44
lines changed

2 files changed

+52
-44
lines changed

.github/workflows/upload_release.yaml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Upload Release
22

33
on:
44
release:
5-
types: published
5+
types: [published]
66

77
jobs:
88
upload:
@@ -18,34 +18,41 @@ jobs:
1818
path: ~/.m2/repository
1919
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2020

21-
- name: Setup Maven Central
21+
- name: Setup Signing
2222
uses: actions/setup-java@v2
2323
with:
2424
java-version: 8.0.292+10
2525
distribution: 'adopt'
26-
27-
server-id: ossrh
28-
server-username: MAVEN_CENTRAL_USERNAME
29-
server-password: MAVEN_CENTRAL_TOKEN
30-
3126
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
3227
gpg-passphrase: MAVEN_GPG_PASSPHRASE
3328

34-
- name: Publish to Maven Central
35-
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
36-
env:
37-
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
38-
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
39-
40-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
41-
4229
- name: Setup GitHub Packages
4330
uses: actions/setup-java@v2
4431
with:
4532
java-version: 8.0.292+10
4633
distribution: 'adopt'
47-
34+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
35+
4836
- name: Publish to GitHub Packages
4937
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
5038
env:
5139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
41+
42+
- name: Setup Maven Central
43+
uses: actions/setup-java@v2
44+
with:
45+
java-version: 8.0.292+10
46+
distribution: 'adopt'
47+
48+
server-id: central-sonatype-org
49+
server-username: CENTRAL_SONATYPE_ORG_USERNAME
50+
server-password: CENTRAL_SONATYPE_ORG_PASSWORD
51+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
52+
53+
- name: Publish to Maven Central
54+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
55+
env:
56+
CENTRAL_SONATYPE_ORG_USERNAME: ${{ secrets.CENTRAL_SONATYPE_ORG_USERNAME }}
57+
CENTRAL_SONATYPE_ORG_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_ORG_PASSWORD }}
58+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
<plugin>
101101
<groupId>org.apache.maven.plugins</groupId>
102102
<artifactId>maven-source-plugin</artifactId>
103-
<version>2.2.1</version>
103+
<version>3.3.0</version>
104104
<executions>
105105
<execution>
106106
<id>attach-sources</id>
@@ -113,7 +113,7 @@
113113
<plugin>
114114
<groupId>org.apache.maven.plugins</groupId>
115115
<artifactId>maven-javadoc-plugin</artifactId>
116-
<version>2.9.1</version>
116+
<version>3.5.0</version>
117117
<executions>
118118
<execution>
119119
<id>attach-javadocs</id>
@@ -185,22 +185,22 @@
185185
<version>1.1.0</version>
186186
<configuration>
187187
<updatePomFile>true</updatePomFile>
188-
<flattenMode>resolveCiFriendliesOnly</flattenMode>
188+
<flattenMode>bom</flattenMode>
189189
</configuration>
190190
<executions>
191191
<execution>
192-
<id>flatten</id>
193-
<phase>process-resources</phase>
192+
<id>flatten.clean</id>
194193
<goals>
195-
<goal>flatten</goal>
194+
<goal>clean</goal>
196195
</goals>
196+
<phase>clean</phase>
197197
</execution>
198198
<execution>
199-
<id>flatten.clean</id>
200-
<phase>clean</phase>
199+
<id>flatten</id>
201200
<goals>
202-
<goal>clean</goal>
201+
<goal>flatten</goal>
203202
</goals>
203+
<phase>process-resources</phase>
204204
</execution>
205205
</executions>
206206
</plugin>
@@ -211,17 +211,29 @@
211211
<id>publish-maven-central</id>
212212
<build>
213213
<plugins>
214+
<plugin>
215+
<groupId>org.sonatype.central</groupId>
216+
<artifactId>central-publishing-maven-plugin</artifactId>
217+
<version>0.5.0</version>
218+
<extensions>true</extensions>
219+
<configuration>
220+
<publishingServerId>central-sonatype-org</publishingServerId>
221+
<tokenAuth>true</tokenAuth>
222+
<autoPublish>true</autoPublish>
223+
<waitUntil>validated</waitUntil>
224+
</configuration>
225+
</plugin>
214226
<plugin>
215227
<groupId>org.apache.maven.plugins</groupId>
216228
<artifactId>maven-gpg-plugin</artifactId>
217229
<version>1.6</version>
218230
<executions>
219231
<execution>
220232
<id>sign-artifacts</id>
221-
<phase>verify</phase>
222233
<goals>
223234
<goal>sign</goal>
224235
</goals>
236+
<phase>verify</phase>
225237
<configuration>
226238
<gpgArguments>
227239
<arg>--pinentry-mode</arg>
@@ -233,20 +245,16 @@
233245
</plugin>
234246
</plugins>
235247
</build>
248+
</profile>
249+
<profile>
250+
<id>publish-github-packages</id>
236251
<distributionManagement>
237-
<snapshotRepository>
238-
<id>ossrh</id>
239-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
240-
</snapshotRepository>
241252
<repository>
242-
<id>ossrh</id>
243-
<name>Central Repository OSSRH</name>
244-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
253+
<id>github</id>
254+
<name>GitHub Packages</name>
255+
<url>https://maven.pkg.github.com/teragrep/jla_01</url>
245256
</repository>
246257
</distributionManagement>
247-
</profile>
248-
<profile>
249-
<id>publish-github-packages</id>
250258
<build>
251259
<plugins>
252260
<plugin>
@@ -256,10 +264,10 @@
256264
<executions>
257265
<execution>
258266
<id>sign-artifacts</id>
259-
<phase>verify</phase>
260267
<goals>
261268
<goal>sign</goal>
262269
</goals>
270+
<phase>verify</phase>
263271
<configuration>
264272
<gpgArguments>
265273
<arg>--pinentry-mode</arg>
@@ -271,13 +279,6 @@
271279
</plugin>
272280
</plugins>
273281
</build>
274-
<distributionManagement>
275-
<repository>
276-
<id>github</id>
277-
<name>GitHub Packages</name>
278-
<url>https://maven.pkg.github.com/teragrep/jla_01</url>
279-
</repository>
280-
</distributionManagement>
281282
</profile>
282283
</profiles>
283284
</project>

0 commit comments

Comments
 (0)