Skip to content

Commit

Permalink
Merge pull request #32 from theam/fix/maven-central-publish-and-build…
Browse files Browse the repository at this point in the history
…-scripts

Fixed: Build and publish scripts
  • Loading branch information
javiertoledo authored Sep 14, 2023
2 parents 0df79dd + b1c3b66 commit 0c2aafb
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/wf_publish-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@01ad6d2663fa6fc4add68e686ff72c415a2cf3c3
- name: Publish package
- name: Publish to Sonatype and Release to Maven Central
uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232
with:
arguments: publish -Pversion=${{ github.event.release.tag_name }}
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ github.event.release.tag_name }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
52 changes: 49 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@ plugins {
id "io.freefair.lombok" version "8.3"
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}

def rootGroup = "com.theagilemonkeys.ellmental"
def rootVersion = properties['version']
def rootSourceCompatibility = properties['sourceCompatibility']
def rootSourceCompatibility = JavaVersion.VERSION_17
def publishablePackages = [
"core": "Core library for eLLMental",
"embeddingsgeneration": "Embeddings generation module for eLLMental",
"embeddingsstore": "Embeddings store module for eLLMental",
"embeddingsspace": "Embeddings space module for eLLMental",
"textgeneration": "Text generation module for eLLMental",
]

allprojects {
repositories {
mavenCentral()
}

tasks.withType(JavaCompile) {
sourceCompatibility = rootSourceCompatibility
targetCompatibility = rootSourceCompatibility
}
}

java {
sourceCompatibility = rootSourceCompatibility
targetCompatibility = rootSourceCompatibility
}

dependencies {
Expand All @@ -27,6 +41,7 @@ dependencies {
subprojects { subproject ->
group = rootGroup
version = rootVersion
description = publishablePackages[subproject.name]

apply plugin: 'java'
apply plugin: 'io.freefair.lombok'
Expand All @@ -48,7 +63,7 @@ subprojects { subproject ->
useJUnitPlatform()
}

if (!subproject.name.startsWith('examples:')) {
if (publishablePackages.containsKey(subproject.name)) {
publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -62,7 +77,25 @@ subprojects { subproject ->
pom {
name = subproject.name
description = subproject.description
// ... other POM properties
url = 'https://github.com/theam/ellmental'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'theam'
name = 'The Agile Monkeys'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/theam/ellmental.git'
developerConnection = 'scm:git:ssh://github.com:theam/ellmental.git'
url = 'https://github.com/theam/ellmental'
}
}
}
}
Expand Down Expand Up @@ -97,3 +130,16 @@ subprojects { subproject ->
tasks.test {
useJUnitPlatform()
}

nexusPublishing {
packageGroup = rootGroup
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
2 changes: 0 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// All the common configuration is set in the root build.gradle file
description = 'Core package of ELLMENTAL, the ultimate AI toolkit for Java'

dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand Down
1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

2 changes: 0 additions & 2 deletions modules/embeddingsgeneration/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// All the common configuration is set in the root build.gradle file
description = 'Embeddings generation component of ELLMENTAL, the ultimate AI toolkit for Java'

dependencies {
implementation 'ch.qos.logback:logback-core:1.4.11'
implementation 'org.slf4j:slf4j-api:2.0.9'
Expand Down
2 changes: 0 additions & 2 deletions modules/embeddingsspace/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// All the common configuration is set in the root build.gradle file
description = 'Embeddings space component of ELLMENTAL, the ultimate AI toolkit for Java'

dependencies {
implementation 'ch.qos.logback:logback-core:1.4.11'
implementation 'org.slf4j:slf4j-api:2.0.9'
Expand Down
6 changes: 0 additions & 6 deletions modules/textgeneration/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// All the common configuration is set in the root build.gradle file
description = 'Text generation module of ELLMENTAL, the ultimate AI toolkit for Java'

dependencies {
implementation 'ch.qos.logback:logback-core:1.4.11'
implementation 'org.slf4j:slf4j-api:2.0.9'
Expand All @@ -12,7 +10,3 @@ dependencies {
testImplementation 'org.mockito:mockito-core:3.+'
testImplementation 'org.mockito:mockito-junit-jupiter:5.5.0'
}

test {
useJUnitPlatform()
}

0 comments on commit 0c2aafb

Please sign in to comment.