From 0aa56e92c1007e86c29c65b21366eba29a83be16 Mon Sep 17 00:00:00 2001 From: Mario Serrano Leones Date: Tue, 28 Jan 2025 06:57:57 -0500 Subject: [PATCH] github release action support --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ sources/pom.xml | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fc758d8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +# Version 5.0.0 +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Release and Deploy + +on: + release: + types: [ created ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + architecture: x64 + distribution: corretto + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + + - name: Build with Maven + run: mvn clean javadoc:jar source:jar deploy -P release-sign-artifacts --file sources/pom.xml + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/sources/pom.xml b/sources/pom.xml index 2ca2e8b..5371469 100644 --- a/sources/pom.xml +++ b/sources/pom.xml @@ -99,7 +99,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh