Compare commits

..

34 Commits

Author SHA1 Message Date
amithkoujalgi
4b49d6004c [maven-release-plugin] prepare release v1.0.21 2023-12-19 19:49:51 +00:00
Amith Koujalgi
7fd27634d4 Merge remote-tracking branch 'origin/main' 2023-12-20 01:18:43 +05:30
Amith Koujalgi
ea64fc4677 clean up 2023-12-20 01:18:30 +05:30
amithkoujalgi
376cd28e0c [maven-release-plugin] prepare for next development iteration 2023-12-19 19:36:06 +00:00
amithkoujalgi
31c47c6468 [maven-release-plugin] prepare release v1.0.20 2023-12-19 19:36:05 +00:00
Amith Koujalgi
2e34a1514c Merge remote-tracking branch 'origin/main' 2023-12-20 01:05:10 +05:30
Amith Koujalgi
dae99e839d clean up 2023-12-20 01:04:58 +05:30
amithkoujalgi
877901ccff [maven-release-plugin] prepare for next development iteration 2023-12-19 19:15:11 +00:00
amithkoujalgi
0fec81eef7 [maven-release-plugin] prepare release v1.0.19 2023-12-19 19:15:08 +00:00
Amith Koujalgi
4dd27b3e1a clean up 2023-12-20 00:44:04 +05:30
amithkoujalgi
a06ededd46 [maven-release-plugin] prepare for next development iteration 2023-12-19 19:02:03 +00:00
amithkoujalgi
1c687831d1 [maven-release-plugin] prepare release v1.0.18 2023-12-19 19:02:02 +00:00
Amith Koujalgi
2c2750b3e1 Merge remote-tracking branch 'origin/main' 2023-12-20 00:31:05 +05:30
Amith Koujalgi
809efa9053 clean up 2023-12-20 00:30:46 +05:30
amithkoujalgi
4a7e9ac7f0 [maven-release-plugin] prepare for next development iteration 2023-12-19 18:50:10 +00:00
amithkoujalgi
04f9e77149 [maven-release-plugin] prepare release v1.0.17 2023-12-19 18:50:08 +00:00
Amith Koujalgi
553e7dab41 clean up 2023-12-20 00:19:13 +05:30
Amith Koujalgi
3a75cd7e92 clean up 2023-12-20 00:16:25 +05:30
amithkoujalgi
c45b5de3ea [maven-release-plugin] prepare release v1.0.16 2023-12-19 18:45:42 +00:00
Amith Koujalgi
6c2b3ca206 clean up 2023-12-20 00:14:45 +05:30
Amith Koujalgi
1ff5fbfc9f clean up 2023-12-20 00:10:55 +05:30
Amith Koujalgi
929242cc26 clean up 2023-12-20 00:02:09 +05:30
amithkoujalgi
d854f82966 [maven-release-plugin] prepare for next development iteration 2023-12-19 18:29:03 +00:00
amithkoujalgi
585858a99a [maven-release-plugin] prepare release v1.0.15 2023-12-19 18:29:02 +00:00
Amith Koujalgi
95fa72c1ec [maven-release-plugin] prepare for next development iteration 2023-12-19 23:58:06 +05:30
Amith Koujalgi
59015dff8f [maven-release-plugin] prepare release v1.0.14 2023-12-19 23:58:03 +05:30
amithkoujalgi
d601ce0e1e [maven-release-plugin] prepare for next development iteration 2023-12-19 18:11:27 +00:00
amithkoujalgi
9820248115 [maven-release-plugin] prepare release v1.0.13 2023-12-19 18:11:26 +00:00
Amith Koujalgi
7ff040f706 clean up 2023-12-19 23:40:23 +05:30
Amith Koujalgi
f4b83c2860 clean up 2023-12-19 23:39:07 +05:30
Amith Koujalgi
082b708927 clean up 2023-12-19 23:35:16 +05:30
Amith Koujalgi
8a895e02fb clean up 2023-12-19 23:33:34 +05:30
Amith Koujalgi
b878fb7b3f clean up 2023-12-19 23:33:08 +05:30
Amith Koujalgi
5c66d8df5f [maven-release-plugin] prepare for next development iteration 2023-12-19 23:26:23 +05:30
5 changed files with 60 additions and 50 deletions

View File

@@ -5,7 +5,7 @@ name: Test and Publish Package
#on:
# release:
# types: [created]
# types: [ "created" ]
on:
push:
@@ -47,15 +47,17 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: mvn -B -ntp clean install
- name: Publish to GitHub Packages Apache Maven
if: >
github.event_name != 'pull_request' &&
github.ref_name == 'main' &&
contains(github.event.head_commit.message, '[release]')
# if: >
# github.event_name != 'pull_request' &&
# github.ref_name == 'main' &&
# contains(github.event.head_commit.message, 'release')
run: |
git config --global user.email "koujalgi.amith@gmail.com"
git config --global user.name "amithkoujalgi"
mvn clean -Punit-tests release:clean release:prepare release:perform -B -Darguments="-DskipTests -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}"
mvn -B -ntp -DskipTests -Pci-cd -Darguments="-DskipTests -Pci-cd" release:clean release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

View File

@@ -1,17 +1,13 @@
build:
mvn -B clean install
ut:
mvn clean test -Punit-tests
it:
mvn clean verify -Pintegration-tests
build:
mvn -B clean test install -Punit-tests -Dgpg.passphrase="${GPG_PASSPHRASE}" -e
release:
mvn -B clean install -Punit-tests release:clean release:prepare release:perform -Dgpg.passphrase="${GPG_PASSPHRASE}" -e
update-version:
mvn versions:set -DnewVersion=1.0.1
deploy:
mvn clean deploy -Punit-tests -Dgpg.passphrase="$GPG_PASSPHRASE" -e
list-releases:
curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=asc&page=0&size=12&filter=namespace%3Aio.github.amithkoujalgi%2Cname%3Aollama4j' \
--compressed \
--silent | jq '.components[].version'

View File

@@ -53,34 +53,25 @@ for [Ollama](https://github.com/jmorganca/ollama/blob/main/docs/api.md) APIs.
#### Installation
In your Maven project, add this dependency available in:
- https://central.sonatype.com/artifact/io.github.amithkoujalgi/ollama4j
- [Central Repository](https://s01.oss.sonatype.org/#nexus-search;quick~ollama4j)
In your Maven project, add this dependency:
```xml
<dependency>
<groupId>io.github.amithkoujalgi</groupId>
<artifactId>ollama4j</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.20</version>
</dependency>
```
You might want to include the Maven repository to pull the ollama4j library from. Include this in
your `pom.xml`:
[![][lib-shield]][lib]
```xml
[lib]: https://central.sonatype.com/artifact/io.github.amithkoujalgi/ollama4j
<repositories>
<repository>
<id>ollama4j-from-ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
```
[lib-shield]: https://img.shields.io/badge/ollama4j-get_latest_version-blue.svg?style=for-the-badge&labelColor=gray
You should also include an implementation of [SL4J](https://www.slf4j.org/) logger in your `pom.xml` file. For example,
You might want to include an implementation of [SL4J](https://www.slf4j.org/) logger in your `pom.xml` file. For
example,
Use `slf4j-jdk14` implementation:

View File

@@ -1,13 +1,16 @@
Understanding publishing:
https://dzone.com/articles/how-to-publish-artifacts-to-maven-central
GPG Signing setup
Reference Repo:
https://github.com/dsibilio/badge-maker/tree/main
## GPG Setup
## GPG Signing setup
### GPG Setup
https://central.sonatype.org/publish/requirements/gpg/#listing-keys
### Steps
#### Steps
- Create key: `gpg --gen-key` and then list keys to verify: `gpg --list-keys`
- Distributing Your Public Key:
@@ -33,4 +36,19 @@ gpg --armor --export-secret-keys 88AA0C903A513340A0F3094326257A6F6F5F24A9 > ~/ol
https://central.sonatype.org/publish/publish-maven/
### Steps
## List release versions
```shell
curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=desc&page=0&size=12&filter=namespace%3Aio.github.amithkoujalgi%2Cname%3Aollama4j' \
--compressed \
--silent | jq '.components[].version'
```
Deployment steps to test. [IGNORE THIS FOR PUBLISHING CONTEXT. THIS IS ONLY TO TEST STUFF OUT LOCALLY]
```shell
# release:
mvn -B clean install deploy -Punit-tests -Dgpg.passphrase="${GPG_PASSPHRASE}" -e
#or
mvn -B clean install -Punit-tests release:clean release:prepare release:perform -Dgpg.passphrase="${GPG_PASSPHRASE}" -e
```

29
pom.xml
View File

@@ -4,7 +4,7 @@
<groupId>io.github.amithkoujalgi</groupId>
<artifactId>ollama4j</artifactId>
<version>1.0.12</version>
<version>1.0.21</version>
<name>Ollama4j</name>
<description>Java library for interacting with Ollama API.</description>
@@ -39,22 +39,11 @@
<connection>scm:git:git@github.com:amithkoujalgi/ollama4j.git</connection>
<developerConnection>scm:git:https://github.com/amithkoujalgi/ollama4j.git</developerConnection>
<url>https://github.com/amithkoujalgi/ollama4j</url>
<tag>v1.0.12</tag>
<tag>v1.0.21</tag>
</scm>
<build>
<plugins>
<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <version>1.6.13</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <serverId>ossrh</serverId>-->
<!-- <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@@ -206,6 +195,9 @@
<skipUnitTests>false</skipUnitTests>
<skipIntegrationTests>true</skipIntegrationTests>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>integration-tests</id>
@@ -246,6 +238,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>