-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: publish API on reposilite maven repository
- Loading branch information
1 parent
f98275d
commit bfde332
Showing
4 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Publish package to the Maven Central Repository and GitHub Packages | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up Java | ||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 | ||
|
||
- name: Publish package | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_diogotcRepositoryUsername: github-ci-triton | ||
ORG_GRADLE_PROJECT_diogotcRepositoryPassword: ${{ secrets.MAVEN_REPO_SECRET }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,64 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
} | ||
|
||
group 'com.rexcantor64.triton' | ||
|
||
apply from: '../gradle/publish.gradle' | ||
|
||
dependencies { | ||
compileOnly 'org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT' | ||
compileOnly 'net.md-5:bungeecord-api:1.17-R0.1-SNAPSHOT' | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
tasks { | ||
jar { | ||
manifest { | ||
attributes 'Automatic-Module-Name': 'com.rexcantor64.triton.api' | ||
} | ||
} | ||
|
||
javadoc { | ||
options.encoding = 'UTF-8' | ||
options.charSet = 'UTF-8' | ||
options.source = '8' | ||
options.links( | ||
'https://hub.spigotmc.org/javadocs/spigot/', | ||
'https://jd.papermc.io/waterfall/1.20/', // Use Waterfall's JavaDocs instead of Bungee's since those are broken | ||
'https://docs.oracle.com/en/java/javase/21/docs/api/', | ||
) | ||
|
||
// Disable the crazy super-strict doclint tool in Java 8 | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
|
||
// Mark sources as Java 8 source compatible | ||
options.source = '8' | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
tritonApi(MavenPublication) { | ||
from components.java | ||
|
||
artifactId = 'triton-api' | ||
|
||
pom { | ||
name.set('Triton API') | ||
description.set('Translate your server! Sends the same message in different languages... Hooks into all plugins!') | ||
url.set('https://triton.rexcantor64.com') | ||
scm { | ||
url.set('https://github.com/tritonmc/Triton') | ||
connection.set('scm:git:https://github.com/tritonmc/Triton.git') | ||
developerConnection.set('scm:git:https://github.com/tritonmc/Triton.git') | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
publishing { | ||
repositories { | ||
maven { | ||
credentials(PasswordCredentials.class) | ||
|
||
name = "diogotcRepository" | ||
def base = 'https://repo.diogotc.com' | ||
def releasesRepoUrl = "$base/releases/" | ||
def snapshotsRepoUrl = "$base/snapshots/" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
} | ||
} | ||
} |