From 6984ece2b653028d6103e9cffeb00078abffd226 Mon Sep 17 00:00:00 2001 From: Amith Koujalgi Date: Fri, 27 Oct 2023 13:09:48 +0530 Subject: [PATCH] init --- .github/workflows/maven-publish.yml | 2 +- .github/workflows/maven-publish1.yml | 29 ++++++++ README.md | 10 +++ pom.xml | 100 ++++++++++++++++++++++++++- 4 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/maven-publish1.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index c1e4f25..72e5e88 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,7 +1,7 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path -name: Maven Package +name: Maven Package Publish to GitHub Packages #on: # release: diff --git a/.github/workflows/maven-publish1.yml b/.github/workflows/maven-publish1.yml new file mode 100644 index 0000000..cd8b575 --- /dev/null +++ b/.github/workflows/maven-publish1.yml @@ -0,0 +1,29 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: CI - Publish to Maven Central Sonatype + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Deploy with Maven + run: mvn -B clean deploy -Pci-cd + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/README.md b/README.md index b48ea7e..c939bf6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ A Java wrapper for [Ollama](https://github.com/jmorganca/ollama/blob/main/docs/api.md) APIs. +Install: + +With Maven from [Nexus](https://s01.oss.sonatype.org/#nexus-search;quick~ollama4j): +```xml + + io.github.amithkoujalgi + ollama4j + 1.0-SNAPSHOT + +``` Start Ollama Container: ``` docker run -v ~/ollama:/root/.ollama -p 11434:11434 ollama/ollama diff --git a/pom.xml b/pom.xml index ba84445..08f45b5 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,61 @@ https://github.com/amithkoujalgi/ollama4j/tree/main - + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + @@ -49,4 +103,48 @@ 5.2.1 + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + ci-cd + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + --pinentry-mode + loopback + + + + + + + + + \ No newline at end of file