Skip to content

Commit ca2342b

Browse files
committed
build: switch to semver, add back shadowjar classifier
1 parent ec04339 commit ca2342b

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "${{ secrets.PGP_BINARY_PRIVATE_KEY }}" | base64 -d > private.key
2929
- name: Publish package to Maven Central
3030
run: |
31-
./gradlew clean publishToMavenCentral --no-build-cache --no-daemon --stacktrace --no-parallel \
31+
./gradlew clean build shadowJar publishToMavenCentral --no-build-cache --no-daemon --stacktrace --no-parallel \
3232
-Psigning.secretKeyRingFile=$PWD/private.key \
3333
-Psigning.keyId=${{ secrets.PGP_KEY_ID }} \
3434
-Psigning.password=${{ secrets.PGP_PASSWORD }}

build.gradle.kts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "wtf.villain"
10-
version = runCommand("git", "rev-parse", "--short", "HEAD") ?: "0.0.0"
10+
version = "1.0.0"
1111

1212
java {
1313
toolchain {
@@ -29,16 +29,18 @@ dependencies {
2929
}
3030

3131
tasks.withType<ShadowJar> {
32-
archiveClassifier.set("")
33-
3432
minimizeJar = true
3533
}
3634

3735
mavenPublishing {
3836
publishToMavenCentral()
3937
signAllPublications()
4038

41-
coordinates(project.group.toString(), project.name, project.version.toString())
39+
coordinates(
40+
groupId = project.group.toString(),
41+
artifactId = project.name,
42+
version = project.version.toString()
43+
)
4244

4345
pom {
4446
name.set(project.name)
@@ -70,15 +72,3 @@ mavenPublishing {
7072
}
7173
}
7274
}
73-
74-
private fun runCommand(vararg command: String): String? {
75-
return try {
76-
val output = providers.exec {
77-
commandLine(*command)
78-
}
79-
80-
output.standardOutput.asText.get().trim()
81-
} catch (_: Throwable) {
82-
null
83-
}
84-
}

0 commit comments

Comments
 (0)