Skip to content

Commit

Permalink
Add publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
jared-invoiced committed Feb 2, 2024
1 parent 786ada8 commit 20cd804
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish

on:
workflow_dispatch: {}

jobs:
publsh:
name: Publish

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Setup Test Java Runtime
id: setup-test-jre
uses: actions/setup-java@v1
with:
java-version: 17
architecture: x64

- name: Configure GPG Key
run: |
set -ex
echo $GPG_SIGNING_PRIVKEY | base64 --decode | gpg --import --batch --yes --pinentry-mode loopback --passphrase "$GPG_SIGNING_PASSPHRASE"
env:
GPG_SIGNING_PRIVKEY: ${{ secrets.GPG_SIGNING_PRIVKEY }}
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}

- name: Publish package
run: |
./gradlew publish -Dorg.gradle.project.nexusUsername=$NEXUS_USERNAME -Dorg.gradle.project.nexusPassword=$NEXUS_PASSWORD -Dorg.gradle.project.signing.gnupg.keyName=$GPG_SIGNING_KEYID -Dorg.gradle.project.signing.gnupg.passphrase=$GPG_SIGNING_PASSPHRASE
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_SIGNING_KEYID: ${{ secrets.GPG_SIGNING_KEYID }}
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
13 changes: 6 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ task fatJar(type: Jar) {
configurations.all {
}

// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}



version = '4.3.0'


// In this section you declare the dependencies for your production and test code
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.9'
Expand Down Expand Up @@ -94,4 +88,9 @@ publishing {
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}
}
}

0 comments on commit 20cd804

Please sign in to comment.