Skip to content

Commit

Permalink
added the maven yml file and updated the mvnsetting file
Browse files Browse the repository at this point in the history
  • Loading branch information
ucf4 committed Aug 21, 2024
1 parent 1c89115 commit 4af9976
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-github.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Maven Packages
name: Deploy to GitHub Packages
on:
push:
branches:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/deploy-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy to Maven Central
on:
push:
tags:
- 'v*.*.*' # Adjust the tag pattern to match your versioning scheme
release:
types: [created] # This triggers the workflow when a release is created

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin

- name: Build and deploy to Maven Central
run: mvn deploy -DrepositoryId=sonatype -Durl=https://mvnrepository.com/gov.cdc.lib-hl7v2-nist-validator
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
7 changes: 7 additions & 0 deletions .github/workflows/mvn-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@
<password>${env.LIB_GITHUB_TOKEN}</password>
</server>
</servers>
<servers>
<server>
<id>sonatype</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,10 @@
<url>https://maven.pkg.github.com/cdcgov/lib-hl7v2-nist-validator</url>
</repository>
</distributionManagement>
<distributionManagement>
<repository>
<id>sonatype</id>
#<url>https://mvnrepository.com/gov.cdc.lib-hl7v2-nist-validator</url>
</repository>
</distributionManagement>
</project>

0 comments on commit 4af9976

Please sign in to comment.