Skip to content

Commit b6309e1

Browse files
committed
Remove release plugin and use versions plugin
1 parent b65a5f4 commit b6309e1

4 files changed

Lines changed: 49 additions & 72 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release to Maven Central
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
permissions:
8+
contents: write
9+
10+
11+
12+
jobs:
13+
build-for-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: master
20+
- name: Setup git config
21+
run: |
22+
git config user.name github-actions
23+
git config user.email github-actions@github.com
24+
25+
- name: Set up JDK 19
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '19'
29+
distribution: 'corretto'
30+
cache: maven
31+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
32+
server-id: central
33+
server-username: MAVEN_USERNAME
34+
server-password: MAVEN_CENTRAL_TOKEN
35+
36+
- if: github.event.release
37+
name: Update version in pom.xml (Release only)
38+
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
39+
- name: Verify and deploy
40+
run: mvn -B deploy --file pom.xml
41+
env:
42+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
43+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
44+
45+
- name: Update dependency graph
46+
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

.github/workflows/build-for-release.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

pom.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,9 @@
150150
</executions>
151151
</plugin>
152152
<plugin>
153-
<groupId>org.apache.maven.plugins</groupId>
154-
<artifactId>maven-release-plugin</artifactId>
155-
<version>3.0.1</version>
156-
<configuration>
157-
<tagNameFormat>v@{project.version}</tagNameFormat>
158-
</configuration>
153+
<groupId>org.codehaus.mojo</groupId>
154+
<artifactId>versions-maven-plugin</artifactId>
155+
<version>2.16.2</version>
159156
</plugin>
160157
</plugins>
161158
</build>

0 commit comments

Comments
 (0)