Skip to content

Commit

Permalink
Remove release plugin and use versions plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlo committed Feb 4, 2024
1 parent b65a5f4 commit b6309e1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 72 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release to Maven Central

on:
release:
types: [ published ]

permissions:
contents: write



jobs:
build-for-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Setup git config
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'corretto'
cache: maven
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN

- if: github.event.release
name: Update version in pom.xml (Release only)
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
- name: Verify and deploy
run: mvn -B deploy --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
40 changes: 0 additions & 40 deletions .github/workflows/build-for-release.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/publish.yml

This file was deleted.

9 changes: 3 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.16.2</version>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit b6309e1

Please sign in to comment.