From a61a2b193b3c8b5abc4de60b7b68b1621be42049 Mon Sep 17 00:00:00 2001 From: Ezequiel Rozen Date: Tue, 30 Apr 2024 19:26:00 +0200 Subject: [PATCH] github action mvn deploy (#68) * github action mvn deploy * github action mvn deploy * change mustache --- .github/workflows/maven-deploy.yml | 33 +++++++++++++++++++++++++++++ pom.xml | 2 +- templates/java/jersey2/pom.mustache | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/maven-deploy.yml diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml new file mode 100644 index 0000000..ba388e8 --- /dev/null +++ b/.github/workflows/maven-deploy.yml @@ -0,0 +1,33 @@ +name: Publish package to the Maven Central Repository + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + - name: Set up Apache Maven Central + uses: actions/setup-java@v4 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '11' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy + gpg-private-key: ${{ secrets.MAVEN_SIGNING_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + + - name: Publish to Apache Maven Central + run: mvn clean deploy -Dmaven.test.skip + env: + MAVEN_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME}} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MVN_CENTRAL_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2429afd..7080a32 100644 --- a/pom.xml +++ b/pom.xml @@ -186,7 +186,7 @@ sign - 0x5F8EB601 + A26C6169 diff --git a/templates/java/jersey2/pom.mustache b/templates/java/jersey2/pom.mustache index 9d72831..43190ba 100644 --- a/templates/java/jersey2/pom.mustache +++ b/templates/java/jersey2/pom.mustache @@ -193,7 +193,7 @@ sign - 0x5F8EB601 + A26C6169