Skip to content

Commit 05b20d5

Browse files
committed
Update CI configuration and Gradle build for improved publishing and dependency management
1 parent 1b75dd7 commit 05b20d5

2 files changed

Lines changed: 77 additions & 75 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434

3535
- name: Run build and tests with Gradle wrapper
3636
run: ./gradlew test build -PdockerTests
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }}
41+
ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }}
3742

3843
- name: Publish test report
3944
uses: mikepenz/action-junit-report@v5
@@ -96,9 +101,9 @@ jobs:
96101
- name: Log in to the Container registry
97102
uses: docker/login-action@v3
98103
with:
99-
registry: ${{ env.REGISTRY }}
100-
username: ${{ github.actor }}
101-
password: ${{ secrets.GITHUB_TOKEN }}
104+
username: ${{ secrets.HARBOR_USERNAME }}
105+
password: ${{ secrets.HARBOR_PASSWORD }}
106+
registry: ${{ secrets.HARBOR_REGISTRY }}
102107

103108
- name: Determine the LuckPerms version
104109
run: |
@@ -108,7 +113,7 @@ jobs:
108113
id: meta
109114
uses: docker/metadata-action@v5
110115
with:
111-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
116+
images: ${{ secrets.HARBOR_REGISTRY }}/luckperms/luckperms-standalone
112117
flavor: |
113118
latest=${{ github.ref == 'refs/heads/master' }}
114119
tags: |

api/build.gradle

Lines changed: 68 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,94 +16,91 @@ dependencies {
1616
}
1717

1818
// Only used occasionally for deployment - not needed for normal builds.
19-
/*
20-
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
21-
apply plugin: 'signing'
22-
23-
javadoc {
24-
title = 'LuckPerms API (v' + project.ext.apiVersion + ')'
25-
options.overview = 'javadoc/overview.html'
26-
options.encoding = 'UTF-8'
27-
options.charSet = 'UTF-8'
28-
options.links(
29-
'https://checkerframework.org/api/',
30-
'https://javadoc.io/static/org.jetbrains/annotations/26.0.2/'
31-
)
32-
options.addStringOption('Xdoclint:none', '-quiet')
33-
options.addStringOption('-since', '5.0,5.1,5.2,5.3,5.4,5.5')
34-
35-
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
36-
options.links.add('https://docs.oracle.com/en/java/javase/21/docs/api/')
37-
} else {
38-
options.links.add('https://docs.oracle.com/javase/8/docs/api/')
39-
}
19+
javadoc {
20+
title = 'LuckPerms API (v' + project.ext.apiVersion + ')'
21+
options.overview = 'javadoc/overview.html'
22+
options.encoding = 'UTF-8'
23+
options.charSet = 'UTF-8'
24+
options.links(
25+
'https://checkerframework.org/api/',
26+
'https://javadoc.io/static/org.jetbrains/annotations/26.0.2/'
27+
)
28+
options.addStringOption('Xdoclint:none', '-quiet')
29+
options.addStringOption('-since', '5.0,5.1,5.2,5.3,5.4,5.5')
30+
31+
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
32+
options.links.add('https://docs.oracle.com/en/java/javase/21/docs/api/')
33+
} else {
34+
options.links.add('https://docs.oracle.com/javase/8/docs/api/')
4035
}
36+
}
4137

42-
java {
43-
withJavadocJar()
44-
withSourcesJar()
45-
}
38+
java {
39+
withJavadocJar()
40+
withSourcesJar()
41+
}
4642

47-
publishing {
48-
repositories {
49-
maven {
50-
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
51-
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
52-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
43+
publishing {
44+
repositories {
45+
maven {
46+
name = 'OneLiteFeatherRepository'
5347

54-
credentials {
55-
username sonatypeUsername
56-
password sonatypePassword
57-
}
48+
def releasesRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-releases')
49+
def snapshotsRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-snapshots')
50+
51+
url = (version.toString().contains('BETA')
52+
|| version.toString().contains('ALPHA')
53+
|| version.toString().contains('SNAPSHOT')) ? snapshotsRepoUrl : releasesRepoUrl
54+
55+
credentials(PasswordCredentials) {
56+
username = System.getenv('ONELITEFEATHER_MAVEN_USERNAME')
57+
password = System.getenv('ONELITEFEATHER_MAVEN_PASSWORD')
58+
}
59+
60+
authentication {
61+
basic(BasicAuthentication)
5862
}
5963
}
64+
}
6065

61-
publications {
62-
mavenJava(MavenPublication) {
63-
artifactId = 'api'
66+
publications {
67+
mavenJava(MavenPublication) {
68+
artifactId = 'api'
6469

65-
from components.java
70+
from components.java
6671

67-
pom {
68-
name = 'LuckPerms API'
69-
description = 'A permissions manager for Minecraft servers.'
70-
url = 'https://luckperms.net'
72+
pom {
73+
name = 'LuckPerms API'
74+
description = 'A permissions manager for Minecraft servers.'
75+
url = 'https://luckperms.net'
7176

72-
licenses {
73-
license {
74-
name = 'MIT'
75-
url = 'https://opensource.org/licenses/MIT'
76-
}
77+
licenses {
78+
license {
79+
name = 'MIT'
80+
url = 'https://opensource.org/licenses/MIT'
7781
}
82+
}
7883

79-
developers {
80-
developer {
81-
id = 'lucko'
82-
name = 'Luck'
83-
url = 'https://lucko.me'
84-
email = 'git@lucko.me'
85-
}
84+
developers {
85+
developer {
86+
id = 'lucko'
87+
name = 'Luck'
88+
url = 'https://lucko.me'
89+
email = 'git@lucko.me'
8690
}
91+
}
8792

88-
scm {
89-
connection = 'scm:git:https://github.com/LuckPerms/LuckPerms.git'
90-
developerConnection = 'scm:git:git@github.com:LuckPerms/LuckPerms.git'
91-
url = 'https://github.com/LuckPerms/LuckPerms'
92-
}
93+
scm {
94+
connection = 'scm:git:https://github.com/OneLiteFeatherNET/LuckPerms.git'
95+
developerConnection = 'scm:git:git@github.com:OneLiteFeatherNET/LuckPerms.git'
96+
url = 'https://github.com/OneLiteFeatherNET/LuckPerms'
97+
}
9398

94-
issueManagement {
95-
system = 'GitHub'
96-
url = 'https://github.com/LuckPerms/LuckPerms/issues'
97-
}
99+
issueManagement {
100+
system = 'GitHub'
101+
url = 'https://github.com/OneLiteFeatherNET/LuckPerms/issues'
98102
}
99103
}
100104
}
101105
}
102-
103-
signing {
104-
useGpgCmd()
105-
sign publishing.publications.mavenJava
106-
required = true
107-
}
108106
}
109-
*/

0 commit comments

Comments
 (0)