MOSIP-37782 Moving code from develop to release-0.9.x branch #665
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Resident-ui build 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' | ||
- release-* | ||
- master | ||
- develop* | ||
- 1* | ||
- MOSIP* | ||
jobs: | ||
build-resident-ui: | ||
uses: mosip/kattu/.github/workflows/npm-build.yml@master | ||
with: | ||
SERVICE_LOCATION: ./resident-ui | ||
BUILD_ARTIFACT: resident-ui | ||
secrets: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
build-docker-resident-ui: | ||
needs: build-resident-ui | ||
strategy: | ||
matrix: | ||
include: | ||
- SERVICE_LOCATION: './resident-ui' | ||
SERVICE_NAME: 'resident-ui' | ||
NPM_BUILD: true | ||
BUILD_ARTIFACT: 'resident-ui' | ||
fail-fast: false | ||
name: ${{ matrix.SERVICE_NAME }} | ||
uses: mosip/kattu/.github/workflows/docker-build.yml@master | ||
with: | ||
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} | ||
SERVICE_NAME: ${{ matrix.SERVICE_NAME }} | ||
NPM_BUILD: ${{ matrix.NPM_BUILD }} | ||
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} | ||
secrets: | ||
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} | ||
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} | ||
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
sonar-analysis: | ||
needs: build-resident-ui | ||
if: "${{ github.event_name != 'pull_request' }}" | ||
uses: mosip/kattu/.github/workflows/npm-sonar-analysis.yml@develop | ||
with: | ||
SERVICE_LOCATION: resident-ui | ||
SONAR_URL: 'https://sonarcloud.io' | ||
PROJECT_KEY: "mosip_${{ github.event.repository.name }}" | ||
secrets: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
ORG_KEY: ${{ secrets.ORG_KEY }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
build-maven-uitest-resident: | ||
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 | ||
with: | ||
SERVICE_LOCATION: ./residenttest | ||
BUILD_ARTIFACT: residenttest | ||
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 }} | ||
build-residentuitests-local: | ||
needs: build-maven-residenttest | ||
Check failure on line 81 in .github/workflows/push-trigger.yml GitHub Actions / Resident-ui build upon a pushInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
env: | ||
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }} | ||
SERVICE_NAME: residenttest | ||
SERVICE_LOCATION: residenttest | ||
BUILD_ARTIFACT: residenttest-local | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
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: Cache local Maven repository | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Setup the settings file for ossrh server | ||
run: echo "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml | ||
- name: Build residentuitests with Maven | ||
run: | | ||
cd ${{ env.SERVICE_LOCATION}} | ||
mvn -U -B package -Dmaven.wagon.http.retryHandler.count=2 --file pom.xml -s $GITHUB_WORKSPACE/settings.xml | ||
- name: Ready the springboot artifacts | ||
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} | ||
run: | | ||
## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY | ||
find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -name '*.jar' -type f -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} + | ||
- name: Upload the springboot jars | ||
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.BUILD_ARTIFACT }} | ||
path: ${{ env.BUILD_ARTIFACT }}.zip | ||
- uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message) | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: failure() # Pick up events even if the job fails or is canceled. | ||
build-docker-residenttest: | ||
needs: build-residentuitests-local | ||
strategy: | ||
matrix: | ||
include: | ||
- SERVICE_LOCATION: 'residenttest' | ||
SERVICE_NAME: 'residenttest' | ||
BUILD_ARTIFACT: 'residenttest-local' | ||
fail-fast: false | ||
name: ${{ matrix.SERVICE_NAME }} | ||
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21 | ||
with: | ||
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} | ||
SERVICE_NAME: ${{ matrix.SERVICE_NAME }} | ||
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} | ||
secrets: | ||
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} | ||
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} | ||
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
#publish_to_nexus_residenttest: | ||
# if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}" | ||
# needs: build-residentuitests-local | ||
# uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master | ||
# with: | ||
# SERVICE_LOCATION: residenttest | ||
# secrets: | ||
# OSSRH_USER: ${{ secrets.OSSRH_USER }} | ||
# OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} | ||
# OSSRH_URL: ${{ secrets.RELEASE_URL }} | ||
# OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | ||
# GPG_SECRET: ${{ secrets.GPG_SECRET }} | ||
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
sonar_analysis_residenttest: | ||
needs: build-residentuitests-local | ||
if: "${{ github.event_name != 'pull_request' }}" | ||
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 | ||
with: | ||
SERVICE_LOCATION: residenttest | ||
SONAR_URL: 'https://sonarcloud.io' | ||
PROJECT_KEY: 'mosip_residenttest' | ||
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 }} |