-
Notifications
You must be signed in to change notification settings - Fork 7
feat: updated pom.xml to release to maven central #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sainikhitha-sayyaparaju
wants to merge
12
commits into
master
Choose a base branch
from
sns-mvn-central-deploy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
559015d
Update pom.xml
sainikhitha-sayyaparaju 020a6f1
Update pom.xml
sainikhitha-sayyaparaju 3c9fa30
testing in PR build
sainikhitha-sayyaparaju c04ed95
Update maven-pr-build.yml
sainikhitha-sayyaparaju 9e4d313
Update maven-pr-build.yml added creds
sainikhitha-sayyaparaju eca0958
Update maven-pr-build.yml
sainikhitha-sayyaparaju 5522f7f
Update maven-pr-build.yml
sainikhitha-sayyaparaju 29db505
Update publish-central.yml
sainikhitha-sayyaparaju 020c71c
Update maven-merge-build.yml
sainikhitha-sayyaparaju 3b39450
Update release-build.yml
sainikhitha-sayyaparaju 4422374
Update publish-central.yml
sainikhitha-sayyaparaju 3060fac
Update publish-central.yml
sainikhitha-sayyaparaju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,40 +1,107 @@ | ||
name: Publish package to the Maven Central Repository | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to deploy (optional, will use pom.xml version if not specified)' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
release: | ||
name: Release on Sonatype OSS | ||
build-and-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Build and test | ||
run: mvn -B clean verify | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: test-results | ||
path: target/surefire-reports/ | ||
retention-days: 30 | ||
|
||
- name: Upload coverage reports | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: coverage-reports | ||
path: target/site/jacoco/ | ||
retention-days: 30 | ||
|
||
publish: | ||
name: Publish to Maven Central | ||
runs-on: ubuntu-latest | ||
needs: build-and-test | ||
if: needs.build-and-test.result == 'success' && (github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'adopt' | ||
distribution: 'temurin' | ||
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- name: Cache Maven packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Set up Apache Maven Central | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v4 | ||
with: # running setup-java again overwrites the settings.xml | ||
java-version: 17 | ||
distribution: 'adopt' | ||
distribution: 'temurin' | ||
server-id: ossrh | ||
server-username: OSSRH_USERNAME | ||
server-password: OSSRH_PASSWORD | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Publish to Apache Maven Central | ||
run: mvn -Prelease deploy | ||
run: mvn -B -Prelease deploy | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
|
||
- name: Create Release Tag | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git tag -a v${{ github.event.inputs.version }} -m "Release version ${{ github.event.inputs.version }}" | ||
git push origin v${{ github.event.inputs.version }} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RWebPulse/pom.xml
Line 221 in 559015d
is this still needed ?