Skip to content

Commit 1c0312a

Browse files
committed
GH Actions: deploy and release workflows
1 parent 8488b3d commit 1c0312a

File tree

3 files changed

+77
-3
lines changed

3 files changed

+77
-3
lines changed

.github/workflows/maven-deploy.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags: [ deploy** ]
7+
8+
jobs:
9+
deploy:
10+
timeout-minutes: 20
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up JDK
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: '8'
22+
distribution: 'adopt'
23+
cache: 'maven'
24+
server-id: ossrh
25+
server-username: MAVEN_USERNAME
26+
server-password: MAVEN_CENTRAL_TOKEN
27+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
29+
- name: Publish to Apache Maven Central
30+
run: mvn --no-transfer-progress -Dmaven.test.skip=true deploy
31+
env:
32+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33+
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/maven-release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags: [ release** ]
7+
8+
jobs:
9+
release:
10+
timeout-minutes: 20
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up JDK
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: '8'
22+
distribution: 'adopt'
23+
cache: 'maven'
24+
server-id: ossrh
25+
server-username: MAVEN_USERNAME
26+
server-password: MAVEN_CENTRAL_TOKEN
27+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
29+
- name: Publish to Apache Maven Central
30+
run: mvn --no-transfer-progress -Dmaven.test.skip=true deploy
31+
env:
32+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33+
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
35+
- name: Release to Apache Maven Central
36+
run: mvn --no-transfer-progress -Dmaven.test.skip=true nexus-staging:release
37+
env:
38+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
39+
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
40+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<plugin>
7474
<groupId>org.sonatype.plugins</groupId>
7575
<artifactId>nexus-staging-maven-plugin</artifactId>
76-
<version>1.6.5</version>
76+
<version>1.6.13</version>
7777
<extensions>true</extensions>
7878
<configuration>
7979
<serverId>ossrh</serverId>
@@ -177,10 +177,10 @@
177177
</plugin>
178178

179179
<plugin>
180+
<groupId>org.apache.maven.plugins</groupId>
180181
<artifactId>maven-deploy-plugin</artifactId>
181-
<version>2.8.2</version>
182+
<version>3.0.0</version>
182183
<configuration>
183-
<uniqueVersion>false</uniqueVersion>
184184
<retryFailedDeploymentCount>10</retryFailedDeploymentCount>
185185
</configuration>
186186
</plugin>

0 commit comments

Comments
 (0)