From d345712523103fe0c3246722a337be74b3efdaf3 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Mon, 2 Dec 2024 17:31:17 +0530 Subject: [PATCH 1/5] [MOSIP-38002] Updated and rename push_trigger.yml to push-trigger.yml Signed-off-by: Praful Rakhade --- .github/workflows/push-trigger.yml | 66 ++++++++++++++++++ .github/workflows/push_trigger.yml | 108 ----------------------------- 2 files changed, 66 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/push-trigger.yml delete mode 100644 .github/workflows/push_trigger.yml diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml new file mode 100644 index 0000000..fd2c079 --- /dev/null +++ b/.github/workflows/push-trigger.yml @@ -0,0 +1,66 @@ +name: Maven Package upon a push + +on: + release: + types: [published] + pull_request: + types: [opened, reopened, synchronize] + workflow_dispatch: + inputs: + message: + description: 'Message for manually triggering' + required: false + default: 'Triggered for Updates' + type: string + push: + branches: + - '!release-branch' + - 'MOSIP*' + - 'develop*' + - 'master' + - '1.*' + - 'release-*' + +jobs: + build-maven-image-compressor: + uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 + with: + SERVICE_LOCATION: image-compressor + BUILD_ARTIFACT: image-compressor + secrets: + OSSRH_USER: ${{ secrets.OSSRH_USER }} + OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + + publish_to_nexus: + if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}" + needs: build-maven-image-compressor + uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21 + with: + SERVICE_LOCATION: image-compressor + secrets: + OSSRH_USER: ${{ secrets.OSSRH_USER }} + OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} + OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + sonar_analysis: + needs: build-maven-image-compressor + if: "${{ github.event_name != 'pull_request' }}" + uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 + with: + SERVICE_LOCATION: image-compressor + PROJECT_KEY: 'mosip_image-compressor' + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + ORG_KEY: ${{ secrets.ORG_KEY }} + OSSRH_USER: ${{ secrets.OSSRH_USER }} + OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml deleted file mode 100644 index 23a931e..0000000 --- a/.github/workflows/push_trigger.yml +++ /dev/null @@ -1,108 +0,0 @@ - -name: Maven Package upon a push - -on: - push: - branches: - - master - - develop - -jobs: - build: - - runs-on: ubuntu-latest - env: - IMAGE_COMPRESSOR_SERVICE_LOCATION: image-compressor - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - ref: ${{ github.ref }} - java-version: 11 - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Setup branch and GPG public key - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo ${{ env.BRANCH_NAME }} - echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.BRANCH_NAME }} - - - name: Install xmllint - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - - - name: Setup the settings file for ossrh server - run: echo " ossrh ${{secrets.RELEASE_USER}} ${{secrets.RELEASE_TOKEN}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false " > $GITHUB_WORKSPACE/settings.xml - - - - name: Build image-compressor with Maven - run: | - cd ./${{ env.IMAGE_COMPRESSOR_SERVICE_LOCATION }} - mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml - - - publish_to_nexus_image-compressor: - runs-on: ubuntu-latest - env: - IMAGE_COMPRESSOR_SERVICE_LOCATION: image-compressor - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - ref: ${{ github.ref }} - java-version: 11 - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Setup branch and GPG public key - run: | - # Strip git ref prefix from version - echo ${{ env.BRANCH_NAME }} - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven-${{ env.BRANCH_NAME }} - - - name: Install xmllint - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - - name: Setup the settings file for ossrh server - run: echo " ossrh ${{secrets.RELEASE_USER}} ${{secrets.RELEASE_TOKEN}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml - - - name: Build with Maven - run: | - cd ./${{ env.IMAGE_COMPRESSOR_SERVICE_LOCATION }} - mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml - - - name: Publish the maven package - run: | - cd ./${{ env.IMAGE_COMPRESSOR_SERVICE_LOCATION }} - mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - GPG_TTY: $(tty) - From 5dc99dbe452c4f92a9d534d9af509613d398e8d4 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Mon, 2 Dec 2024 17:44:31 +0530 Subject: [PATCH 2/5] [MOSIP-38002] Updated and rename push_trigger.yml to push-trigger.yml Signed-off-by: Praful Rakhade --- .github/workflows/push-trigger.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index fd2c079..e92922d 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -23,7 +23,7 @@ on: jobs: build-maven-image-compressor: - uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 + uses: mosip/kattu/.github/workflows/maven-build.yml@master with: SERVICE_LOCATION: image-compressor BUILD_ARTIFACT: image-compressor @@ -38,7 +38,7 @@ jobs: publish_to_nexus: if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}" needs: build-maven-image-compressor - uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21 + uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master with: SERVICE_LOCATION: image-compressor secrets: @@ -52,7 +52,7 @@ jobs: sonar_analysis: needs: build-maven-image-compressor if: "${{ github.event_name != 'pull_request' }}" - uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 + uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master with: SERVICE_LOCATION: image-compressor PROJECT_KEY: 'mosip_image-compressor' From e8e031c3a067e4678bb4a1a1ebeefb5e67323839 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Mon, 2 Dec 2024 17:50:44 +0530 Subject: [PATCH 3/5] [MOSIP-38002] Updated and rename push_trigger.yml to push-trigger.yml Signed-off-by: Praful Rakhade --- image-compressor/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image-compressor/pom.xml b/image-compressor/pom.xml index 378663c..4612674 100644 --- a/image-compressor/pom.xml +++ b/image-compressor/pom.xml @@ -70,9 +70,9 @@ 2.3 - 1.2.0.1-SNAPSHOT + 1.2.0.1 1.2.0.1-B2 - 1.2.0.1-B2-SNAPSHOT + 1.2.0.1-B2 1.7.25 From 568cc2b01a7e1d3f198424748b92e584650e925a Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Mon, 2 Dec 2024 17:53:36 +0530 Subject: [PATCH 4/5] [MOSIP-38002] Updated and rename push_trigger.yml to push-trigger.yml Signed-off-by: Praful Rakhade --- image-compressor/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image-compressor/pom.xml b/image-compressor/pom.xml index 4612674..8bf5a5f 100644 --- a/image-compressor/pom.xml +++ b/image-compressor/pom.xml @@ -71,8 +71,8 @@ 1.2.0.1 - 1.2.0.1-B2 - 1.2.0.1-B2 + 1.2.0.1 + 1.2.0.1 1.7.25 From aea35e323a5da2bccc1f1f74ca267add32d0a832 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Mon, 2 Dec 2024 18:10:55 +0530 Subject: [PATCH 5/5] [MOSIP-38002] Updated and rename push_trigger.yml to push-trigger.yml Signed-off-by: Praful Rakhade --- image-compressor/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image-compressor/pom.xml b/image-compressor/pom.xml index 8bf5a5f..988b960 100644 --- a/image-compressor/pom.xml +++ b/image-compressor/pom.xml @@ -71,8 +71,8 @@ 1.2.0.1 - 1.2.0.1 - 1.2.0.1 + 1.2.0.2 + 1.2.0.2 1.7.25