-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INFRA-407: Add
maven-set-settings.xml
reusable workflow. (#20)
- Loading branch information
1 parent
38a9ba3
commit 7b169ec
Showing
4 changed files
with
86 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,42 +30,13 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
- name: Set settings | ||
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-set-settings.yml@main | ||
with: | ||
java-version: ${{ inputs.java-version }} | ||
distribution: ${{ inputs.java-distribution }} | ||
cache: 'maven' | ||
|
||
- name: Set settings.xml | ||
uses: s4u/[email protected] | ||
with: | ||
servers: | | ||
[{ | ||
"id": "mks-private-repo", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-snapshots", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-releases", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-snapshots", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-releases", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}] | ||
java-distribution: ${{ inputs.java-distribution }} | ||
nexus-username: ${{ secrets.NEXUS_USERNAME }} | ||
nexus-password: ${{ secrets.NEXUS_PASSWORD }} | ||
|
||
- name: Build with Maven | ||
run: 'mvn --batch-mode --update-snapshots clean verify ${{ inputs.maven-args }}' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,43 +30,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ inputs.java-version }} | ||
distribution: ${{ inputs.java-distribution }} | ||
cache: 'maven' | ||
|
||
- name: Set settings.xml | ||
uses: s4u/maven-[email protected] | ||
- name: Set settings | ||
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-set-settings.yml@main | ||
with: | ||
servers: | | ||
[{ | ||
"id": "mks-private-repo", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-snapshots", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-releases", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-snapshots", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-releases", | ||
"username": "${{ secrets.NEXUS_USERNAME }}", | ||
"password": "${{ secrets.NEXUS_PASSWORD }}" | ||
}] | ||
java-version: ${{ inputs.java-version }} | ||
java-distribution: ${{ inputs.java-distribution }} | ||
nexus-username: ${{ secrets.NEXUS_USERNAME }} | ||
nexus-password: ${{ secrets.NEXUS_PASSWORD }} | ||
|
||
- name: Publish maven artifacts | ||
run: 'mvn --batch-mode clean deploy ${{ inputs.maven-args }}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Maven Set settings.xml | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
java-version: | ||
description: 'Java version to use for building' | ||
required: false | ||
type: string | ||
default: '17' | ||
java-distribution: | ||
description: 'Java distribution to use for building' | ||
required: false | ||
type: string | ||
default: 'temurin' | ||
nexus-username: | ||
description: 'Username for the Nexus repository' | ||
required: true | ||
type: string | ||
nexus-password: | ||
description: 'Password for the Nexus repository' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
set-settings: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up JDK ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ inputs.java-version }} | ||
distribution: ${{ inputs.java-distribution }} | ||
cache: 'maven' | ||
|
||
- name: Set settings.xml | ||
uses: s4u/[email protected] | ||
with: | ||
servers: | | ||
[{ | ||
"id": "mks-private-repo", | ||
"username": "${{ inputs.nexus-username }}", | ||
"password": "${{ inputs.nexus-password }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-snapshots", | ||
"username": "${{ inputs.nexus-username }}", | ||
"password": "${{ inputs.nexus-password }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-public-releases", | ||
"username": "${{ inputs.nexus-username }}", | ||
"password": "${{ inputs.nexus-password }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-snapshots", | ||
"username": "${{ inputs.nexus-username }}", | ||
"password": "${{ inputs.nexus-password }}" | ||
}, | ||
{ | ||
"id": "mks-nexus-private-releases", | ||
"username": "${{ inputs.nexus-username }}", | ||
"password": "${{ inputs.nexus-password }}" | ||
}] |