Skip to content

Commit

Permalink
Updates to deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
jecihjoy committed Jan 4, 2024
1 parent de5242e commit a8863db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 43 deletions.
62 changes: 22 additions & 40 deletions .github/workflows/maven_deploy_cicd.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/[email protected]
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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<reportingVersion>1.18.0</reportingVersion>
<serializationxstreamVersion>0.2.14</serializationxstreamVersion>
<uiframeworkVersion>3.15.0</uiframeworkVersion>
<kenyaemrVersion>18.0.0</kenyaemrVersion>
<kenyacoreVersion>3.0.0</kenyacoreVersion>
<kenyaemrVersion>18.7.0</kenyaemrVersion>
<kenyacoreVersion>3.0.1</kenyacoreVersion>
<kenyauiVersion>3.0.0</kenyauiVersion>
<hivtestingservicesVersion>1.2.0</hivtestingservicesVersion>
<hivtestingservicesVersion>1.5.0</hivtestingservicesVersion>

<jodaTimeVersion>2.9.1</jodaTimeVersion>
<jacksonVersion>2.13.1</jacksonVersion>
Expand Down

0 comments on commit a8863db

Please sign in to comment.