Skip to content

Commit

Permalink
enable docker and brew publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed Nov 3, 2024
1 parent 77876e7 commit 5f9f7cd
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Setup Env
run: echo "${{ vars.GRADLE_PROPERTIES }}" > gradle.properties
run: echo "${{ vars.GRADLE_PROPERTIES }}" >> gradle.properties

- name: Run Tests
env:
Expand Down Expand Up @@ -55,5 +55,5 @@ jobs:
with:
name: jreleaser-log
path: |
tessellate-main/build/jreleaser/trace.log
tessellate-main/build/jreleaser/output.properties
build/jreleaser/trace.log
build/jreleaser/output.properties
117 changes: 117 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jreleaser.model.Active
import org.jreleaser.model.Distribution
import org.jreleaser.model.Stereotype
import java.io.FileInputStream
import java.util.*

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

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

repositories {
mavenCentral()

maven {
url = uri("https://maven.pkg.github.com/cwensel/*")
name = "github"
credentials(PasswordCredentials::class) {
username = (project.findProperty("githubUsername") ?: System.getenv("USERNAME")) as? String
password = (project.findProperty("githubPassword") ?: System.getenv("GITHUB_TOKEN")) as? String
}
content {
includeVersionByRegex("net.wensel", "cascading-.*", ".*-wip-.*")
}
}
}

dependencies {
Expand All @@ -50,9 +66,16 @@ dependencies {
}

application {
applicationName = "subpop"
mainClass = "io.clusterless.subpop.Main"
}

distributions {
main {
distributionBaseName.set("subpop")
}
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
Expand Down Expand Up @@ -82,3 +105,97 @@ micronaut {
tasks.named<io.micronaut.gradle.docker.NativeImageDockerfile>("dockerfileNative") {
jdkVersion = "21"
}

jreleaser {
dryrun.set(false)

project {
description.set("SubPop is a command line utility for finding the differences between one or more tabular datasets.")
authors.add("Chris K Wensel")
copyright.set("Chris K Wensel")
license.set("MPL-2.0")
stereotype.set(Stereotype.CLI)
links {
homepage.set("https://github.com/ClusterlessHQ")
}
inceptionYear.set("2024")
gitRootSearch.set(true)
}

signing {
armored.set(true)
active.set(Active.ALWAYS)
verify.set(false)
}

release {
github {
overwrite.set(true)
sign.set(false)
repoOwner.set("ClusterlessHQ")
name.set("subpop")
username.set("cwensel")
branch.set("wip-1.0")
changelog.enabled.set(false)
milestone.close.set(false)
}
}

distributions {
create("subpop") {
distributionType.set(Distribution.DistributionType.JAVA_BINARY)
executable {
name.set("subpop")
}
artifact {
path.set(file("build/distributions/{{distributionName}}-{{projectVersion}}.zip"))
}
}
}

packagers {
brew {
active.set(Active.ALWAYS)
repository.active.set(Active.ALWAYS)
}

docker {
active.set(Active.ALWAYS)

repository {
repoOwner.set("ClusterlessHQ")
name.set("subpop-docker")
}

registries {
create("DEFAULT") {
externalLogin.set(true)
repositoryName.set("clusterless")
}
}

buildx {
enabled.set(false)
platform("linux/amd64")
platform("linux/arm64")
}

imageName("{{owner}}/{{distributionName}}:{{projectVersion}}")

if (buildRelease) {
imageName("{{owner}}/{{distributionName}}:{{projectVersionMajor}}")
imageName("{{owner}}/{{distributionName}}:{{projectVersionMajor}}.{{projectVersionMinor}}")
imageName("{{owner}}/{{distributionName}}:latest")
} else {
imageName("{{owner}}/{{distributionName}}:latest-wip")
}
}
}
}

tasks.register("release") {
dependsOn("distZip")
dependsOn("jreleaserRelease")
dependsOn("jreleaserPackage")
dependsOn("jreleaserPublish")
}
27 changes: 27 additions & 0 deletions src/jreleaser/distributions/subpop/docker/Dockerfile.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# {{jreleaserCreationStamp}}
FROM {{dockerBaseImage}}

{{#dockerLabels}}
LABEL {{.}}
{{/dockerLabels}}

{{#dockerPreCommands}}
{{.}}
{{/dockerPreCommands}}

COPY assembly/* /

RUN unzip {{distributionArtifactFile}} && \
rm {{distributionArtifactFile}} && \
chmod +x {{distributionArtifactRootEntryName}}/bin/{{distributionExecutableUnix}} && \
mv /{{distributionArtifactRootEntryName}} /{{distributionExecutableName}}

ENV PATH="${PATH}:/{{distributionExecutableName}}/bin"

{{#dockerPostCommands}}
{{.}}
{{/dockerPostCommands}}

ENTRYPOINT ["/{{distributionExecutableName}}/bin/{{distributionExecutableName}}"]

CMD ["--help"]

0 comments on commit 5f9f7cd

Please sign in to comment.