Skip to content

Commit 43dca7b

Browse files
committed
enable docker and brew publishing
1 parent 77876e7 commit 43dca7b

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

build.gradle.kts

+117
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jreleaser.model.Active
2+
import org.jreleaser.model.Distribution
3+
import org.jreleaser.model.Stereotype
14
import java.io.FileInputStream
25
import java.util.*
36

@@ -12,6 +15,7 @@ import java.util.*
1215
plugins {
1316
id("com.github.johnrengelman.shadow") version "8.1.1"
1417
id("io.micronaut.application") version "4.4.3"
18+
id("org.jreleaser") version "1.14.0"
1519
}
1620

1721
val versionProperties = Properties().apply {
@@ -30,6 +34,18 @@ group = "io.clusterless"
3034

3135
repositories {
3236
mavenCentral()
37+
38+
maven {
39+
url = uri("https://maven.pkg.github.com/cwensel/*")
40+
name = "github"
41+
credentials(PasswordCredentials::class) {
42+
username = (project.findProperty("githubUsername") ?: System.getenv("USERNAME")) as? String
43+
password = (project.findProperty("githubPassword") ?: System.getenv("GITHUB_TOKEN")) as? String
44+
}
45+
content {
46+
includeVersionByRegex("net.wensel", "cascading-.*", ".*-wip-.*")
47+
}
48+
}
3349
}
3450

3551
dependencies {
@@ -50,9 +66,16 @@ dependencies {
5066
}
5167

5268
application {
69+
applicationName = "subpop"
5370
mainClass = "io.clusterless.subpop.Main"
5471
}
5572

73+
distributions {
74+
main {
75+
distributionBaseName.set("subpop")
76+
}
77+
}
78+
5679
java {
5780
sourceCompatibility = JavaVersion.VERSION_21
5881
targetCompatibility = JavaVersion.VERSION_21
@@ -82,3 +105,97 @@ micronaut {
82105
tasks.named<io.micronaut.gradle.docker.NativeImageDockerfile>("dockerfileNative") {
83106
jdkVersion = "21"
84107
}
108+
109+
jreleaser {
110+
dryrun.set(false)
111+
112+
project {
113+
description.set("SubPop is a command line utility for finding the differences between one or more tabular datasets.")
114+
authors.add("Chris K Wensel")
115+
copyright.set("Chris K Wensel")
116+
license.set("MPL-2.0")
117+
stereotype.set(Stereotype.CLI)
118+
links {
119+
homepage.set("https://github.com/ClusterlessHQ")
120+
}
121+
inceptionYear.set("2024")
122+
gitRootSearch.set(true)
123+
}
124+
125+
signing {
126+
armored.set(true)
127+
active.set(Active.ALWAYS)
128+
verify.set(false)
129+
}
130+
131+
release {
132+
github {
133+
overwrite.set(true)
134+
sign.set(false)
135+
repoOwner.set("ClusterlessHQ")
136+
name.set("subpop")
137+
username.set("cwensel")
138+
branch.set("wip-1.0")
139+
changelog.enabled.set(false)
140+
milestone.close.set(false)
141+
}
142+
}
143+
144+
distributions {
145+
create("subpop") {
146+
distributionType.set(Distribution.DistributionType.JAVA_BINARY)
147+
executable {
148+
name.set("tess")
149+
}
150+
artifact {
151+
path.set(file("build/distributions/{{distributionName}}-{{projectVersion}}.zip"))
152+
}
153+
}
154+
}
155+
156+
packagers {
157+
brew {
158+
active.set(Active.ALWAYS)
159+
repository.active.set(Active.ALWAYS)
160+
}
161+
162+
docker {
163+
active.set(Active.ALWAYS)
164+
165+
repository {
166+
repoOwner.set("ClusterlessHQ")
167+
name.set("subpop-docker")
168+
}
169+
170+
registries {
171+
create("DEFAULT") {
172+
externalLogin.set(true)
173+
repositoryName.set("clusterless")
174+
}
175+
}
176+
177+
buildx {
178+
enabled.set(false)
179+
platform("linux/amd64")
180+
platform("linux/arm64")
181+
}
182+
183+
imageName("{{owner}}/{{distributionName}}:{{projectVersion}}")
184+
185+
if (buildRelease) {
186+
imageName("{{owner}}/{{distributionName}}:{{projectVersionMajor}}")
187+
imageName("{{owner}}/{{distributionName}}:{{projectVersionMajor}}.{{projectVersionMinor}}")
188+
imageName("{{owner}}/{{distributionName}}:latest")
189+
} else {
190+
imageName("{{owner}}/{{distributionName}}:latest-wip")
191+
}
192+
}
193+
}
194+
}
195+
196+
tasks.register("release") {
197+
dependsOn("distZip")
198+
dependsOn("jreleaserRelease")
199+
dependsOn("jreleaserPackage")
200+
dependsOn("jreleaserPublish")
201+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# {{jreleaserCreationStamp}}
2+
FROM {{dockerBaseImage}}
3+
4+
{{#dockerLabels}}
5+
LABEL {{.}}
6+
{{/dockerLabels}}
7+
8+
{{#dockerPreCommands}}
9+
{{.}}
10+
{{/dockerPreCommands}}
11+
12+
COPY assembly/* /
13+
14+
RUN unzip {{distributionArtifactFile}} && \
15+
rm {{distributionArtifactFile}} && \
16+
chmod +x {{distributionArtifactRootEntryName}}/bin/{{distributionExecutableUnix}} && \
17+
mv /{{distributionArtifactRootEntryName}} /{{distributionExecutableName}}
18+
19+
ENV PATH="${PATH}:/{{distributionExecutableName}}/bin"
20+
21+
{{#dockerPostCommands}}
22+
{{.}}
23+
{{/dockerPostCommands}}
24+
25+
ENTRYPOINT ["/{{distributionExecutableName}}/bin/{{distributionExecutableName}}"]
26+
27+
CMD ["--help"]

0 commit comments

Comments
 (0)