From b8202108d5cb9c23c9c51b3b5981bc31c5eac1f6 Mon Sep 17 00:00:00 2001 From: jecihjoy Date: Tue, 2 Jan 2024 12:00:31 +0300 Subject: [PATCH 1/6] KHP3-4866: Add ability to publish module to nexus --- pom.xml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 758c5d7..7b19ac5 100644 --- a/pom.xml +++ b/pom.xml @@ -419,7 +419,17 @@ - - - + + + mks-nexus + Mekom Nexus Releases + https://nexus.mekomsolutions.net/releases + + + mks-nexus + Mekom Nexus Snapshots + https://nexus.mekomsolutions.net/snapshots + + + From a17877a4f045c43dc879a54d6c23e2efe7549a4f Mon Sep 17 00:00:00 2001 From: RAJAB IBRAHIM Date: Wed, 3 Jan 2024 09:40:27 +0300 Subject: [PATCH 2/6] Create maven_deploy_cicd.yml --- .github/workflows/maven_deploy_cicd.yml | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/maven_deploy_cicd.yml diff --git a/.github/workflows/maven_deploy_cicd.yml b/.github/workflows/maven_deploy_cicd.yml new file mode 100644 index 0000000..4ccd12d --- /dev/null +++ b/.github/workflows/maven_deploy_cicd.yml @@ -0,0 +1,61 @@ +name: Deploy to Nexus + +on: + # Manually triggered workflow using the "Run workflow" button + workflow_dispatch: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + #set up the build enviroment + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + + # Build with Maven + - name: Build with Maven + run: mvn -B package -DskipTests + + + publish: + runs-on: ubuntu-latest + # Define dependencies, this job depends on the completion of the "build" job + needs: build + + # Specify conditions for when this job should run + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + + # Set up enviroment for Publish + + steps: + #set up the build enviroment + - name: Checkout Repository + uses: actions/checkout@v4 + # Step 2: Set up JDK 8 for Publish + - name: Set up JDK 8 for Publish + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '8' + server-id: mks-nexus + server-username: $MAVEN_USERNAME + server-password: $MAVEN_TOKEN + + - name: Publish to Nexus repository + run: mvn -B deploy + + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} From de5242e5609739367597c60dcf5840dce7415582 Mon Sep 17 00:00:00 2001 From: RAJAB IBRAHIM Date: Wed, 3 Jan 2024 10:00:04 +0300 Subject: [PATCH 3/6] Update pom.xml --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7b19ac5..42c6545 100644 --- a/pom.xml +++ b/pom.xml @@ -399,20 +399,20 @@ openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://mavenrepo.openmrs.org/nexus/content/repositories/public central Maven Repository Switchboard default - http://repo1.maven.org/maven2 + https://repo1.maven.org/maven2 openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://mavenrepo.openmrs.org/nexus/content/repositories/public false From a8863dbfe889545babe001d7d3c06d56fd71285d Mon Sep 17 00:00:00 2001 From: jecihjoy Date: Thu, 4 Jan 2024 14:36:13 +0300 Subject: [PATCH 4/6] Updates to deployment script --- .github/workflows/maven_deploy_cicd.yml | 62 +++++++++---------------- pom.xml | 6 +-- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/.github/workflows/maven_deploy_cicd.yml b/.github/workflows/maven_deploy_cicd.yml index 4ccd12d..5c7651c 100644 --- a/.github/workflows/maven_deploy_cicd.yml +++ b/.github/workflows/maven_deploy_cicd.yml @@ -1,17 +1,15 @@ -name: Deploy to Nexus +name: Build and Publish to Nexus on: # Manually triggered workflow using the "Run workflow" button workflow_dispatch: push: branches: [ master ] - pull_request: - branches: [ master ] - + jobs: - build: + publish: runs-on: ubuntu-latest - + #set up the build enviroment steps: - name: Checkout Repository @@ -20,42 +18,26 @@ jobs: - name: Set up JDK 8 uses: actions/setup-java@v4 with: - java-version: '8' distribution: 'temurin' - cache: maven + java-version: '8' - # Build with Maven - name: Build with Maven run: mvn -B package -DskipTests - - - publish: - runs-on: ubuntu-latest - # Define dependencies, this job depends on the completion of the "build" job - needs: build - - # Specify conditions for when this job should run - if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - - # Set up enviroment for Publish - - steps: - #set up the build enviroment - - name: Checkout Repository - uses: actions/checkout@v4 - # Step 2: Set up JDK 8 for Publish - - name: Set up JDK 8 for Publish - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '8' - server-id: mks-nexus - server-username: $MAVEN_USERNAME - server-password: $MAVEN_TOKEN - - - name: Publish to Nexus repository - run: mvn -B deploy - env: - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} + - name: Set settings.xml + uses: s4u/maven-settings-action@v3.0.0 + with: + servers: | + [{ + "id": "mks-repo", + "username": "${{ secrets.MAVEN_USERNAME }}", + "password": "${{ secrets.MAVEN_TOKEN }}" + }, + { + "id": "mks-repo-snapshots", + "username": "${{ secrets.MAVEN_USERNAME }}", + "password": "${{ secrets.MAVEN_TOKEN }}" + }] + + - name: Publish + run: mvn --batch-mode clean deploy -DskipTests diff --git a/pom.xml b/pom.xml index 42c6545..b39b4a2 100644 --- a/pom.xml +++ b/pom.xml @@ -42,10 +42,10 @@ 1.18.0 0.2.14 3.15.0 - 18.0.0 - 3.0.0 + 18.7.0 + 3.0.1 3.0.0 - 1.2.0 + 1.5.0 2.9.1 2.13.1 From b2ff29d195589d4b4d5b2b8b9a190c5faf1cc9cb Mon Sep 17 00:00:00 2001 From: jecihjoy Date: Thu, 4 Jan 2024 16:58:46 +0300 Subject: [PATCH 5/6] Update nexus repository url --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b39b4a2..c55c184 100644 --- a/pom.xml +++ b/pom.xml @@ -421,14 +421,14 @@ - mks-nexus - Mekom Nexus Releases - https://nexus.mekomsolutions.net/releases + mks-repo + Mekom Solutions Nexus Releases + https://nexus.mekomsolutions.net/repository/maven-releases - mks-nexus - Mekom Nexus Snapshots - https://nexus.mekomsolutions.net/snapshots + mks-repo-snapshots + Mekom Solutions Nexus Snapshots + https://nexus.mekomsolutions.net/repository/maven-snapshots From b6a69c2c347b569a0a91ccee26c43f5bd93fcbd0 Mon Sep 17 00:00:00 2001 From: jecihjoy Date: Thu, 4 Jan 2024 17:21:59 +0300 Subject: [PATCH 6/6] update aftastat version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c55c184..e66985d 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 18.7.0 3.0.1 3.0.0 - 1.5.0 + 1.5.1 2.9.1 2.13.1