From 259633cdf845ffe9f7d544762d4371adb19c3053 Mon Sep 17 00:00:00 2001 From: mahesh-wor Date: Thu, 28 May 2026 20:58:16 +0545 Subject: [PATCH] infra: update to use ssh keys instead of password for publishing artifacts --- .github/workflows/CI.yml | 17 +++++++++-------- java/services/pom.xml | 4 ++-- java/web/pom.xml | 4 ++-- pom.xml | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index da7e99a448..4d2d54f512 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -204,26 +204,27 @@ jobs: ############ # Publish ########## + - name: Setup SSH Agent + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.MAPSTORE_MAVEN_SSH_KEY }} + - name: Trust Maven Host + run: ssh-keyscan -H maven.geo-solutions.it >> ~/.ssh/known_hosts - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: java-version: '11' distribution: 'temurin' server-id: geosolutions - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-username: MAPSTORE_MAVEN_USERNAME + - name: Publish maven packages # Here it deploys only java modules and root, needed for MS project builds. # Product, binary modules are to big to be hosted on the repository in snapshots, so they are skipped run: | - # Setup SSH keys for SFTP - mkdir -p ~/.ssh && chmod 700 ~/.ssh - # add geo-solutions.it to known hosts to avoid prompts - ssh-keyscan -H maven.geo-solutions.it >> ~/.ssh/known_hosts # deploys java packages mvn clean install deploy -f java/pom.xml # deploys also the root module, needed for dependencies mvn deploy --non-recursive env: - MAVEN_USERNAME: ${{ secrets.GS_MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.GS_MAVEN_PASSWORD }} + MAPSTORE_MAVEN_USERNAME: ${{ secrets.MAPSTORE_MAVEN_USERNAME }} \ No newline at end of file diff --git a/java/services/pom.xml b/java/services/pom.xml index 5eae8354eb..72419b2dd1 100644 --- a/java/services/pom.xml +++ b/java/services/pom.xml @@ -163,7 +163,7 @@ org.apache.maven.wagon - wagon-ssh + wagon-ssh-external 3.5.3 @@ -171,7 +171,7 @@ geosolutions - sftp://maven.geo-solutions.it/ + scpexe://maven.geo-solutions.it/ diff --git a/java/web/pom.xml b/java/web/pom.xml index a8adc7748b..af03374534 100644 --- a/java/web/pom.xml +++ b/java/web/pom.xml @@ -108,7 +108,7 @@ org.apache.maven.wagon - wagon-ssh + wagon-ssh-external 3.5.3 @@ -117,7 +117,7 @@ geosolutions - sftp://maven.geo-solutions.it/ + scpexe://maven.geo-solutions.it/ diff --git a/pom.xml b/pom.xml index af056d25c1..796d329a32 100644 --- a/pom.xml +++ b/pom.xml @@ -397,7 +397,7 @@ geosolutions - sftp://maven.geo-solutions.it/ + scpexe://maven.geo-solutions.it/ @@ -464,7 +464,7 @@ org.apache.maven.wagon - wagon-ssh + wagon-ssh-external 3.5.3