WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 7d073bd

Browse files
authored
Merge pull request #28 from launchableinc/fix_deploy_issue
fix deploy issue
2 parents ca73656 + b278246 commit 7d073bd

File tree

5 files changed

+16
-58
lines changed

5 files changed

+16
-58
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ jobs:
2626
needs: tagpr
2727
if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
2828
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
31-
packages: write
3229
steps:
3330
- uses: actions/checkout@v4
3431
- name: Set up JDK 21
@@ -40,7 +37,10 @@ jobs:
4037
uses: gradle/actions/setup-gradle@v4
4138
- name: Test
4239
run: ./gradlew test
43-
- name: Publish to GitHub Packages
44-
run: ./gradlew publish
40+
- name: Publish to Maven Central
41+
run: ./gradlew publishAllPublicationsToMavenCentralRepository
4542
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
44+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
46+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}

api/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java-library'
2+
apply plugin: "com.vanniktech.maven.publish"
23

34
dependencies {
45
api libs.jacksonAnnotations

build.gradle

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,13 @@
11
plugins {
2-
id 'maven-publish'
2+
id "com.vanniktech.maven.publish" version "0.34.0"
33
}
44

5-
subprojects {
6-
apply plugin: 'maven-publish'
7-
8-
plugins.withId('java') {
9-
publishing {
10-
repositories {
11-
maven {
12-
name = "GitHubPackages"
13-
url = "https://maven.pkg.github.com/launchableinc/openai-java"
14-
credentials {
15-
username = System.getenv("GITHUB_ACTOR")
16-
password = System.getenv("GITHUB_TOKEN")
17-
}
18-
}
19-
}
20-
21-
publications {
22-
maven(MavenPublication) {
23-
from components.java
24-
25-
groupId = 'com.launchableinc.openai-java'
26-
artifactId = project.name
27-
version = project.VERSION_NAME
28-
29-
pom {
30-
name = 'OpenAI Java Client'
31-
description = 'Java client library for OpenAI API'
32-
url = 'https://github.com/launchableinc/openai-java'
33-
34-
licenses {
35-
license {
36-
name = 'The MIT License'
37-
url = 'https://www.mit.edu/~amini/LICENSE.md'
38-
}
39-
}
40-
41-
developers {
42-
developer {
43-
id = 'engineering'
44-
name = 'Engineering'
45-
}
46-
}
47-
48-
scm {
49-
connection = 'scm:git:[email protected]:launchableinc/openai-java.git'
50-
developerConnection = 'scm:git:[email protected]:launchableinc/openai-java.git'
51-
url = 'https://github.com/launchableinc/openai-java'
52-
}
53-
}
54-
}
55-
}
5+
allprojects {
6+
plugins.withId("com.vanniktech.maven.publish") {
7+
mavenPublishing {
8+
// Publish to Maven Central via Central Portal (no authentication required for users!)
9+
publishToMavenCentral()
10+
signAllPublications()
5611
}
5712
}
5813
}

client/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java-library'
2+
apply plugin: "com.vanniktech.maven.publish"
23

34
dependencies {
45
api project(":api")

service/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java-library'
2+
apply plugin: "com.vanniktech.maven.publish"
23

34
dependencies {
45
api project(":client")

0 commit comments

Comments
 (0)