From ce3dea7b5c1951d9a9900827c4bc3956602d8266 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Tue, 5 Mar 2024 17:44:18 -0500 Subject: [PATCH] Add credentials to maven-publish.yml As per https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4280 Used eclipse-store as inspiration: https://github.com/eclipse-store/store/blob/main/.github/workflows/maven_deploy_snapshot.yml Signed-off-by: Matthew Khouzam --- .github/workflows/maven-publish.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 4800eb1..a4dea58 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -22,13 +22,16 @@ jobs: with: java-version: '11' distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + cache: 'maven' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD - - name: Build with Maven - run: mvn -B package --file pom.xml - - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + - name: Publish to Maven Central Repository + run: mvn --batch-mode deploy -s $GITHUB_WORKSPACE/settings.xml env: - GITHUB_TOKEN: ${{ github.token }} + MAVEN_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} + PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} +