Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ucf4 committed Aug 29, 2024
1 parent c681bd5 commit 8722f32
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 54 deletions.
64 changes: 34 additions & 30 deletions .github/workflows/deploy-to-github.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
name: Java CI/CD Pipeline
name: Deploy to GitHub Packages
on:
push:
branches:
- testm
push:
branches:
- maven
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
# - name: Decrypt GPG key
# run: |
# echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 --decode | gpg --batch --import
# env:
# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build with Maven
run: mvn clean install
- name: Publish to Maven Central
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: mvn clean deploy -P release --settings .github/maven-settings.xml
- name: Verify JAR signing
run: gpg --verify target/*.asc
publish:
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
cache: maven

- name: Publish Package - lib-hl7v2-nist
run: mvn -B package

# - name: Publish package to github Repo
# run: mvn clean deploy --settings .github/workflows/mvn-settings.xml
# env:
# LIB_GITHUB_ACTOR: '${{ secrets.LIB_GITHUB_ACTOR }}'
# LIB_GITHUB_TOKEN: '${{ secrets.LIB_GITHUB_TOKEN }}'

- name: Publish package to Maven Central
run: mvn clean deploy --settings .github/workflows/mvn-settings.xml
env:
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
GPG_PASSPHRASE: '${{ secrets.GPG_PASSPHRASE }}'
GPG_PRIVATE_KEY: '${{ secrets.GPG_PRIVATE_KEY }}'
22 changes: 9 additions & 13 deletions .github/workflows/mvn-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>SONATYPE</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
<id>central</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>release</id>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
<server>
<id>gpg</id>
<privatekey>${env.GPG_PRIVATE_KEY}</privatekey>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
</server>
</servers>
</settings>
16 changes: 5 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,11 @@
<url>https://github.com/CDCgov/lib-hl7v2-nist-validator/tree/main</url>
</scm>
<distributionManagement>
<!--<repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/cdcgov/lib-hl7v2-nist-validator</url>
</repository>-->
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
Expand Down Expand Up @@ -103,7 +94,10 @@
</execution>
</executions>
<configuration>
<gpgPassphrase>${env.GPG_PASSPHRASE}</gpgPassphrase>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 8722f32

Please sign in to comment.