From 865a97217fd90c6982c210e8232c7c40381eaa27 Mon Sep 17 00:00:00 2001 From: ase-101 Date: Fri, 19 Nov 2021 16:44:51 +0530 Subject: [PATCH] Revert "Flow change for admin-ui build" --- .github/workflows/push_trigger.yml | 1622 ++++++++++++++-------------- 1 file changed, 811 insertions(+), 811 deletions(-) diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml index d30a194e68a..51d9baf3749 100644 --- a/.github/workflows/push_trigger.yml +++ b/.github/workflows/push_trigger.yml @@ -11,646 +11,646 @@ on: - MOSIP-11719 jobs: -# build-kernel-ref-idobjectvalidator: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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 + build-kernel-ref-idobjectvalidator: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 kernel + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd kernel + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_kernel-ref-idobjectvalidator -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 kernel -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd kernel -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_kernel-ref-idobjectvalidator -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# build-pre-registration-booking-service: -# -# runs-on: ubuntu-latest -# env: -# NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} -# SERVICE_NAME: pre-registration-booking-service -# SERVICE_LOCATION: pre-registration-booking-service -# steps: -# - uses: actions/checkout@v2 -# - name: Set up JDK 11 -# uses: actions/setup-java@v1 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + build-pre-registration-booking-service: + + runs-on: ubuntu-latest + env: + NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} + SERVICE_NAME: pre-registration-booking-service + SERVICE_LOCATION: pre-registration-booking-service + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.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 + + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 pre-registration-booking-service + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd pre-registration-booking-service + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_pre-registration-booking-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build image + run: | + cd "./${{env.SERVICE_LOCATION}}" + docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} + + - name: Log into registry + run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=$NAMESPACE/$SERVICE_NAME + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + VERSION=$BRANCH_NAME + echo "push version $VERSION" + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $SERVICE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION +# - uses: 8398a7/action-slack@v3 # 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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.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 -# -# - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 pre-registration-booking-service -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd pre-registration-booking-service -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_pre-registration-booking-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Build image -# run: | -# cd "./${{env.SERVICE_LOCATION}}" -# docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} -# -# - name: Log into registry -# run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin -# -# - name: Push image -# run: | -# IMAGE_ID=$NAMESPACE/$SERVICE_NAME -# # Change all uppercase to lowercase -# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') -# VERSION=$BRANCH_NAME -# echo "push version $VERSION" -# echo IMAGE_ID=$IMAGE_ID -# echo VERSION=$VERSION -# docker tag $SERVICE_NAME $IMAGE_ID:$VERSION -# docker push $IMAGE_ID:$VERSION -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# publish_to_nexus_kernel_prereg: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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.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 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + publish_to_nexus_kernel_prereg: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.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 kernel + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Publish the maven package + run: | + cd kernel && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml + cd .. + cd pre-registration-booking-service && 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) +# - uses: 8398a7/action-slack@v3 # 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 kernel -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Publish the maven package -# run: | -# cd kernel && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml -# cd .. -# cd pre-registration-booking-service && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} -# GPG_TTY: $(tty) -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# docker-registration-processor-external-stage: -# -# runs-on: ubuntu-latest -# env: -# NAMESPACE: mosipdev -# SERVICE_NAME: registration-processor-external-stage -# SERVICE_LOCATION: registration-processor/registration-processor-external-stage -# -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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.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 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + docker-registration-processor-external-stage: + + runs-on: ubuntu-latest + env: + NAMESPACE: mosipdev + SERVICE_NAME: registration-processor-external-stage + SERVICE_LOCATION: registration-processor/registration-processor-external-stage + + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.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.ossrh_user}} ${{secrets.ossrh_secret}} 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 registration-processor/registration-processor-external-stage + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd registration-processor/registration-processor-external-stage + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_registration-processor-external-stage -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build image + run: | + cd "./${{env.SERVICE_LOCATION}}" + docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} + + - name: Log into registry + run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=$NAMESPACE/$SERVICE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + VERSION=$BRANCH_NAME + echo "push version $VERSION" + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $SERVICE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 registration-processor/registration-processor-external-stage -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd registration-processor/registration-processor-external-stage -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_registration-processor-external-stage -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Build image -# run: | -# cd "./${{env.SERVICE_LOCATION}}" -# docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} -# -# - name: Log into registry -# run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin -# -# - name: Push image -# run: | -# IMAGE_ID=$NAMESPACE/$SERVICE_NAME -# -# # Change all uppercase to lowercase -# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') -# VERSION=$BRANCH_NAME -# echo "push version $VERSION" -# echo IMAGE_ID=$IMAGE_ID -# echo VERSION=$VERSION -# docker tag $SERVICE_NAME $IMAGE_ID:$VERSION -# docker push $IMAGE_ID:$VERSION -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# docker-registration-processor-external-integration-service: -# -# runs-on: ubuntu-latest -# env: -# NAMESPACE: mosipdev -# SERVICE_NAME: registration-processor-external-integration-service -# SERVICE_LOCATION: registration-processor/registration-processor-external-integration-service -# -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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.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 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + docker-registration-processor-external-integration-service: + + runs-on: ubuntu-latest + env: + NAMESPACE: mosipdev + SERVICE_NAME: registration-processor-external-integration-service + SERVICE_LOCATION: registration-processor/registration-processor-external-integration-service + + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.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.ossrh_user}} ${{secrets.ossrh_secret}} 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 registration-processor/registration-processor-external-integration-service + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd registration-processor/registration-processor-external-integration-service + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_registration-processor-external-integration-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build image + run: | + cd "./${{env.SERVICE_LOCATION}}" + docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} + + - name: Log into registry + run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=$NAMESPACE/$SERVICE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + VERSION=$BRANCH_NAME + echo "push version $VERSION" + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $SERVICE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 registration-processor/registration-processor-external-integration-service -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd registration-processor/registration-processor-external-integration-service -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_registration-processor-external-integration-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Build image -# run: | -# cd "./${{env.SERVICE_LOCATION}}" -# docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} -# -# - name: Log into registry -# run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin -# -# - name: Push image -# run: | -# IMAGE_ID=$NAMESPACE/$SERVICE_NAME -# -# # Change all uppercase to lowercase -# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') -# VERSION=$BRANCH_NAME -# echo "push version $VERSION" -# echo IMAGE_ID=$IMAGE_ID -# echo VERSION=$VERSION -# docker tag $SERVICE_NAME $IMAGE_ID:$VERSION -# docker push $IMAGE_ID:$VERSION -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# build-biosdk-client: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 biosdk-client -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd biosdk-client -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Publish the maven package -# run: | -# cd biosdk-client && 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) -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# # This workflow contains a single job for building and pushing biosdk service docker" -# build-biosdk-service: -# -# runs-on: ubuntu-latest -# env: -# NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} -# SERVICE_NAME: biosdk-server -# SERVICE_LOCATION: biosdk-services -# -# # Steps represent a sequence of tasks that will be executed as part of the job -# steps: -# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it -# - uses: actions/checkout@v2 -# - uses: actions/setup-node@v1 -# -# - name: Setup branch and env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - name: setup environment -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# -# - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 biosdk-services -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Analyze with SonarCloud -# run: | -# cd biosdk-services -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Build image -# run: | -# cd "./${{env.SERVICE_LOCATION}}" -# docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} -# -# - name: Log into registry -# run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin -# -# - name: Push image -# run: | -# IMAGE_ID=$NAMESPACE/$SERVICE_NAME -# # Change all uppercase to lowercase -# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') -# VERSION=$BRANCH_NAME -# echo "push version $VERSION" -# echo IMAGE_ID=$IMAGE_ID -# echo VERSION=$VERSION -# docker tag $SERVICE_NAME $IMAGE_ID:$VERSION -# docker push $IMAGE_ID:$VERSION -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# build-cache-provider-hazelcast: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - 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 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + build-biosdk-client: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 biosdk-client + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd biosdk-client + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Publish the maven package + run: | + cd biosdk-client && 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) +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 cache-provider-hazelcast -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Publish the maven package -# run: | -# cd cache-provider-hazelcast && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} -# GPG_TTY: $(tty) -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. - - - build-admin-ui: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + # This workflow contains a single job for building and pushing biosdk service docker" + build-biosdk-service: + runs-on: ubuntu-latest env: NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} - SERVICE_NAME: admin-ui - SERVICE_LOCATION: admin-ui + SERVICE_NAME: biosdk-server + SERVICE_LOCATION: biosdk-services + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + + - name: Setup branch and env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - name: setup environment + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 biosdk-services + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Analyze with SonarCloud + run: | + cd biosdk-services + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-service -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build image + run: | + cd "./${{env.SERVICE_LOCATION}}" + docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} + + - name: Log into registry + run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=$NAMESPACE/$SERVICE_NAME + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + VERSION=$BRANCH_NAME + echo "push version $VERSION" + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $SERVICE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION +# - uses: 8398a7/action-slack@v3 +# with: +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + build-cache-provider-hazelcast: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 cache-provider-hazelcast + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Publish the maven package + run: | + cd cache-provider-hazelcast && 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) +# - uses: 8398a7/action-slack@v3 +# with: +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + +# build-admin-ui: +# runs-on: ubuntu-latest +# env: +# NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} +# SERVICE_NAME: admin-ui +# SERVICE_LOCATION: admin-ui # # # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -722,196 +722,196 @@ jobs: # if: failure() # Pick up events even if the job fails or is canceled. # This workflow contains a single job called "build" -# build-keycloak: -# -# runs-on: ubuntu-latest -# env: -# NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} -# SERVICE_NAME: mosip-keycloak -# SERVICE_LOCATION: keycloak -# -# # Steps represent a sequence of tasks that will be executed as part of the job -# steps: -# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it -# - uses: actions/checkout@v2 -# - uses: actions/setup-node@v1 -# -# - name: Setup branch and env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# -# - name: setup environment -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# -# - name: Build image -# run: | -# cd "./${{env.SERVICE_LOCATION}}" -# docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} -# -# - name: Log into registry -# run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin -# -# - name: Push image -# run: | -# IMAGE_ID=$NAMESPACE/$SERVICE_NAME -# -# # Change all uppercase to lowercase -# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') -# VERSION=$BRANCH_NAME -# echo "push version $VERSION" -# echo IMAGE_ID=$IMAGE_ID -# echo VERSION=$VERSION -# docker tag $SERVICE_NAME $IMAGE_ID:$VERSION -# docker push $IMAGE_ID:$VERSION -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# -# build-demosdk: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# - 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 + build-keycloak: + + runs-on: ubuntu-latest + env: + NAMESPACE: ${{ secrets. dev_namespace_docker_hub }} + SERVICE_NAME: mosip-keycloak + SERVICE_LOCATION: keycloak + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + + - name: Setup branch and env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - name: setup environment + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + + - name: Build image + run: | + cd "./${{env.SERVICE_LOCATION}}" + docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }} + + - name: Log into registry + run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin + + - name: Push image + run: | + IMAGE_ID=$NAMESPACE/$SERVICE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + VERSION=$BRANCH_NAME + echo "push version $VERSION" + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $SERVICE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 demosdk -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd demosdk -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Publish the maven package -# run: | -# cd demosdk && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} -# GPG_TTY: $(tty) -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# -# -# build-authentication-ref-impl: -# -# runs-on: ubuntu-latest -# 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 env -# run: | -# # Strip git ref prefix from version -# echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV -# echo "GPG_TTY=$(tty)" >> $GITHUB_ENV -# - 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 +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + + build-demosdk: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 demosdk + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd demosdk + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Publish the maven package + run: | + cd demosdk && 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) +# - uses: 8398a7/action-slack@v3 # 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 authentication -# mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml -# - name: Ready the springboot artifacts -# run: find -name '*.jar' -executable -type f -exec zip release.zip {} + -# -# - name: Analyze with SonarCloud -# run: | -# cd authentication -# mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# -# - name: Publish the maven package -# run: | -# cd authentication && mvn deploy -DskipTests -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. + + + build-authentication-ref-impl: + + runs-on: ubuntu-latest + 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 env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + - 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.ossrh_user}} ${{secrets.ossrh_secret}} 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 authentication + mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml + - name: Ready the springboot artifacts + run: find -name '*.jar' -executable -type f -exec zip release.zip {} + + + - name: Analyze with SonarCloud + run: | + cd authentication + mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_biosdk-client -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Publish the maven package + run: | + cd authentication && 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) +# - uses: 8398a7/action-slack@v3 +# with: +# status: ${{ job.status }} +# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) # env: -# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} -# GPG_TTY: $(tty) -## - uses: 8398a7/action-slack@v3 -## with: -## status: ${{ job.status }} -## fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message) -## env: -## SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required -## if: failure() # Pick up events even if the job fails or is canceled. -# +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required +# if: failure() # Pick up events even if the job fails or is canceled. +