Skip to content

Commit

Permalink
rename release artifacts to tessellate, instead of abbreviated name tess
Browse files Browse the repository at this point in the history
this also includes a Docker packager configuration, but is disabled until jreleaser 1.8
  • Loading branch information
cwensel committed Jul 18, 2023
1 parent ad6b78d commit 485d8f9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 6 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ jobs:
run: |
./gradlew --no-daemon --info --stacktrace check
- name: Release
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Release and Publish
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
Expand Down
49 changes: 44 additions & 5 deletions tessellate-main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@ plugins {
java
application
`java-test-fixtures`
id("org.jreleaser") version "1.6.0"
id("org.jreleaser") version "1.7.0"
}

val versionProperties = Properties().apply {
load(FileInputStream(File(rootProject.rootDir, "version.properties")))
}

val release = false;
val buildRelease = false
val buildNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "dev"
val wipReleases = "wip-${buildNumber}"

version = if (release)
version = if (buildRelease)
"${versionProperties["release.major"]}-${versionProperties["release.minor"]}"
else "${versionProperties["release.major"]}-${wipReleases}"


repositories {
mavenCentral()

Expand Down Expand Up @@ -203,6 +202,12 @@ application {
mainClass.set("io.clusterless.tessellate.Main")
}

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

jreleaser {
dryrun.set(false)

Expand Down Expand Up @@ -239,16 +244,50 @@ jreleaser {
}

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

packagers {
docker {
active.set(Active.ALWAYS)
repository {
repoOwner.set("clusterless")
name.set("tessellate")
tagName.set("{{projectVersion}}")
}

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

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")
// disable until 1.8.0 is released
// dependsOn("jreleaserPublish")
}
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 485d8f9

Please sign in to comment.