Skip to content

Commit

Permalink
Merge pull request #9 from mxenabled/mc/build_settings_file
Browse files Browse the repository at this point in the history
Build settings file
  • Loading branch information
mcoats13 authored Oct 26, 2021
2 parents 5c0c9c0 + 3321da3 commit 38a9156
Show file tree
Hide file tree
Showing 3 changed files with 631 additions and 609 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@ jobs:
distribution: 'adopt'
java-version: '11'

- name: Build settings file
uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >
[
{
"id": "ossrh",
"username": "${env.MAVEN_USERNAME}",
"password": "${env.MAVEN_PASSWORD}"
},
{
"id": "gpg.passphrase",
"passphrase": "${env.MAVEN_GPG_PASSPHRASE}"
}
]
active_profiles: >
[
"sign-artifacts"
]
output_file: .m2/settings.xml

- name: Build with Maven
run: mvn -B package --file pom.xml

Expand All @@ -24,13 +45,14 @@ jobs:
distribution: 'adopt'
java-version: '11'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn -B deploy -P sign-artifacts
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
Loading

0 comments on commit 38a9156

Please sign in to comment.