mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-05-14 19:37:11 +02:00
updated publishing config
This commit is contained in:
parent
bc4e8303aa
commit
cfa8aa14d7
58
.github/workflows/gh-mvn-publish.yml
vendored
Normal file
58
.github/workflows/gh-mvn-publish.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Release Artifacts to GitHub Maven Packages
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ created ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
server-id: github
|
||||
settings-path: ${{ github.workspace }}
|
||||
|
||||
- name: maven-settings-xml-action
|
||||
uses: whelk-io/maven-settings-xml-action@v22
|
||||
with:
|
||||
servers: '[{ "id": "${repo.id}", "username": "${repo.user}", "password": "${repo.pass}" }]'
|
||||
|
||||
- name: Find and Replace
|
||||
uses: jacobtomlinson/gha-find-replace@v3
|
||||
with:
|
||||
find: "ollama4j-revision"
|
||||
replace: ${{ github.ref_name }}
|
||||
regex: false
|
||||
|
||||
- name: Find and Replace
|
||||
uses: jacobtomlinson/gha-find-replace@v3
|
||||
with:
|
||||
find: "mvn-repo-id"
|
||||
replace: github
|
||||
regex: false
|
||||
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- name: List keys
|
||||
run: gpg -K
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn --file pom.xml -U clean package -Punit-tests
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy -Punit-tests -s $GITHUB_WORKSPACE/settings.xml -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Drepo.id=github -Drepo.user=${{ secrets.GH_MVN_USER }} -Drepo.pass=${{ secrets.GH_MVN_PASS }} -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/ollama4j/ollama4j
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
68
.github/workflows/maven-publish.yml
vendored
68
.github/workflows/maven-publish.yml
vendored
@ -1,22 +1,31 @@
|
||||
# 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: Release Artifacts
|
||||
name: Release Artifacts to Maven Central
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ created ]
|
||||
|
||||
|
||||
#on:
|
||||
# pull_request:
|
||||
# types: [ opened, reopened ]
|
||||
# branches: [ "main" ]
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
@ -25,6 +34,19 @@ jobs:
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: maven-settings-xml-action
|
||||
uses: whelk-io/maven-settings-xml-action@v22
|
||||
with:
|
||||
servers: '[{ "id": "${repo.id}", "username": "${repo.user}", "password": "${repo.pass}" }]'
|
||||
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- name: List keys
|
||||
run: gpg -K
|
||||
|
||||
- name: Find and Replace
|
||||
uses: jacobtomlinson/gha-find-replace@v3
|
||||
with:
|
||||
@ -32,10 +54,42 @@ jobs:
|
||||
replace: ${{ github.ref_name }}
|
||||
regex: false
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn --file pom.xml -U clean package -Punit-tests
|
||||
- name: Find and Replace
|
||||
uses: jacobtomlinson/gha-find-replace@v3
|
||||
with:
|
||||
find: "mvn-repo-id"
|
||||
replace: central
|
||||
regex: false
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
|
||||
- name: Publish to Maven Central
|
||||
run: mvn deploy -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Drepo.id=central -Drepo.user=${{ secrets.MVN_USER }} -Drepo.pass=${{ secrets.MVN_PASS }}
|
||||
|
||||
- name: Upload Release Asset - JAR
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: target/ollama4j-${{ github.ref_name }}.jar
|
||||
asset_name: ollama4j-${{ github.ref_name }}.jar
|
||||
asset_content_type: application/x-jar
|
||||
|
||||
- name: Upload Release Asset - Javadoc JAR
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: target/ollama4j-${{ github.ref_name }}-javadoc.jar
|
||||
asset_name: ollama4j-${{ github.ref_name }}-javadoc.jar
|
||||
asset_content_type: application/x-jar
|
||||
|
||||
- name: Upload Release Asset - Sources JAR
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: target/ollama4j-${{ github.ref_name }}-sources.jar
|
||||
asset_name: ollama4j-${{ github.ref_name }}-sources.jar
|
||||
asset_content_type: application/x-jar
|
162
pom.xml
162
pom.xml
@ -3,7 +3,7 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.github.amithkoujalgi</groupId>
|
||||
<groupId>io.github.ollama4j</groupId>
|
||||
<artifactId>ollama4j</artifactId>
|
||||
<version>ollama4j-revision</version>
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<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.16</tag>
|
||||
<tag>ollama4j-revision</tag>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
@ -72,27 +72,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
|
||||
<!-- <version>1.5</version>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>sign-artifacts</id>-->
|
||||
<!-- <phase>verify</phase>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>sign</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <!– This is necessary for gpg to not try to use the pinentry programs –>-->
|
||||
<!-- <gpgArguments>-->
|
||||
<!-- <arg>--pinentry-mode</arg>-->
|
||||
<!-- <arg>loopback</arg>-->
|
||||
<!-- </gpgArguments>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
|
||||
<!-- Surefire Plugin for Unit Tests -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@ -129,15 +109,23 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-release-plugin</artifactId>-->
|
||||
<!-- <version>3.0.1</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <!– <goals>install</goals>–>-->
|
||||
<!-- <tagNameFormat>v@{project.version}</tagNameFormat>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@ -189,27 +177,39 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- <distributionManagement>-->
|
||||
<!-- <snapshotRepository>-->
|
||||
<!-- <id>ossrh</id>-->
|
||||
<!-- <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>-->
|
||||
<!-- </snapshotRepository>-->
|
||||
<!-- <repository>-->
|
||||
<!-- <id>ossrh</id>-->
|
||||
<!-- <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>-->
|
||||
<!-- </repository>-->
|
||||
<!-- </distributionManagement>-->
|
||||
|
||||
<!-- Replaced publishing packages to GitHub Packages instead of Maven central -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>github</id>
|
||||
<name>GitHub Packages</name>
|
||||
<url>https://maven.pkg.github.com/amithkoujalgi/ollama4j</url>
|
||||
<id>mvn-repo-id</id>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<gpg.executable>gpg2</gpg.executable>
|
||||
<test.env>unit</test.env>
|
||||
<skipUnitTests>false</skipUnitTests>
|
||||
<skipIntegrationTests>true</skipIntegrationTests>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<publishingServerId>mvn-repo-id</publishingServerId>
|
||||
<autoPublish>false</autoPublish>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>unit-tests</id>
|
||||
<properties>
|
||||
@ -218,7 +218,7 @@
|
||||
<skipIntegrationTests>true</skipIntegrationTests>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
@ -261,39 +261,39 @@
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
|
||||
<!-- <version>3.1.0</version>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>sign-artifacts</id>-->
|
||||
<!-- <phase>verify</phase>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>sign</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <!– Prevent gpg from using pinentry programs. Fixes:-->
|
||||
<!-- gpg: signing failed: Inappropriate ioctl for device –>-->
|
||||
<!-- <gpgArguments>-->
|
||||
<!-- <arg>--pinentry-mode</arg>-->
|
||||
<!-- <arg>loopback</arg>-->
|
||||
<!-- </gpgArguments>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </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>-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Prevent gpg from using pinentry programs. Fixes:
|
||||
gpg: signing failed: Inappropriate ioctl for device -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</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>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user