Skip to content

Commit c3dbd37

Browse files
committed
fix: publishing
1 parent 81c3d45 commit c3dbd37

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Build
3737
uses: gradle/gradle-build-action@v2
3838
with:
39-
arguments: checkLicenses build
39+
arguments: build
4040

4141
- name: Perform CodeQL Analysis
4242
uses: github/codeql-action/analyze@v2

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Publish
2525
uses: gradle/gradle-build-action@v2
2626
with:
27-
arguments: :lib:publish
27+
arguments: publish
2828
env:
2929
SNAPSHOT: ${{ env.release.prerelease }}
3030
NEXUS_REPOSITORY_URL: ${{ env.release.prerelease == 'true' && secrets.NEXUS_SNAPSHOT_URL || secrets.NEXUS_RELEASE_URL }}

build.gradle.kts

+53
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.time.format.DateTimeFormatter // gradle treats java.time as the java extension, not an import
2323

2424
plugins {
25+
java
26+
`maven-publish`
2527
id("fabric-loom") version("0.12-SNAPSHOT")
2628
id("io.github.juuxel.loom-quiltflower") version("1.7.3")
2729
id("org.cadixdev.licenser") version("0.6.1")
@@ -144,3 +146,54 @@ tasks.withType<Jar>() {
144146
)
145147
}
146148
}
149+
150+
publishing {
151+
publications {
152+
register("mavenJava", MavenPublication::class) {
153+
groupId = group.toString()
154+
artifactId = modId
155+
version = version
156+
if (System.getenv("SNAPSHOT") == "true") {
157+
version += "-SNAPSHOT"
158+
}
159+
160+
from(components["java"])
161+
162+
pom {
163+
organization {
164+
name.set("Team Galacticraft")
165+
url.set("https://github.com/TeamGalacticraft")
166+
}
167+
168+
scm {
169+
url.set("https://github.com/TeamGalacticraft/DynamicDimensions")
170+
connection.set("scm:git:git://github.com/TeamGalacticraft/DynamicDimensions.git")
171+
developerConnection.set("scm:git:[email protected]:TeamGalacticraft/DynamicDimensions.git")
172+
}
173+
174+
issueManagement {
175+
system.set("github")
176+
url.set("https://github.com/TeamGalacticraft/DynamicDimensions/issues")
177+
}
178+
179+
licenses {
180+
license {
181+
name.set("MIT")
182+
url.set("https://github.com/TeamGalacticraft/DynamicDimensions/blob/main/LICENSE")
183+
}
184+
}
185+
}
186+
}
187+
}
188+
189+
repositories {
190+
if (System.getenv().containsKey("NEXUS_REPOSITORY_URL")) {
191+
maven(System.getenv("NEXUS_REPOSITORY_URL")!!) {
192+
credentials {
193+
username = System.getenv("NEXUS_USER")
194+
password = System.getenv("NEXUS_PASSWORD")
195+
}
196+
}
197+
}
198+
}
199+
}

0 commit comments

Comments
 (0)