Skip to content

Commit

Permalink
include wip build in --version. publish to homebrew tap.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed Oct 24, 2023
1 parent c889510 commit 6a3a1b4
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.JRELEASER_HOMEBREW_GITHUB_TOKEN }}
run: |
./gradlew --no-daemon --info --stacktrace release
Expand Down
20 changes: 16 additions & 4 deletions tessellate-main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
java
application
`java-test-fixtures`
id("org.jreleaser") version "1.7.0"
id("org.jreleaser") version "1.8.0"
}

val versionProperties = Properties().apply {
Expand Down Expand Up @@ -195,6 +195,13 @@ testing {
configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())
configurations["integrationTestImplementation"].extendsFrom(configurations.testImplementation.get())

tasks.named<ProcessResources>("processResources") {
doFirst {
file("${buildDir}/resources/main/version.properties")
.writeText("release.full=${version}")
}
}

tasks.named("check") {
dependsOn(testing.suites.named("integrationTest"))
}
Expand Down Expand Up @@ -264,8 +271,13 @@ jreleaser {
}

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

docker {
active.set(Active.NEVER)
repository {
repoOwner.set("clusterless")
name.set("tessellate")
Expand Down Expand Up @@ -296,6 +308,6 @@ jreleaser {
tasks.register("release") {
dependsOn("distZip")
dependsOn("jreleaserRelease")
// disable until 1.8.0 is released
// dependsOn("jreleaserPublish")
dependsOn("jreleaserPackage")
dependsOn("jreleaserPublish")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.clusterless.tessellate.util.JSONUtil;
import io.clusterless.tessellate.util.MetricsPrinter;
import io.clusterless.tessellate.util.Verbosity;
import io.clusterless.tessellate.util.VersionProvider;
import picocli.CommandLine;

import java.io.IOException;
Expand All @@ -29,7 +30,7 @@
@CommandLine.Command(
name = "tess",
mixinStandardHelpOptions = true,
version = "1.0-wip",
versionProvider = VersionProvider.class,
sortOptions = false
)
public class Main implements Callable<Integer> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2023 Chris K Wensel <[email protected]>. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package io.clusterless.tessellate.util;

import picocli.CommandLine;

public class VersionProvider implements CommandLine.IVersionProvider {
@Override
public String[] getVersion() throws Exception {
return new String[]{Versions.clsVersion()};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2023 Chris K Wensel <[email protected]>. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package io.clusterless.tessellate.util;

import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Versions {
public static final String WIP = "1.0-wip-dev";

public static String clsVersion() {
Properties properties = new Properties();

try {
properties.load(resourceAsStream());
} catch (IOException e) {
return WIP;
}

return properties.getProperty("release.full", WIP);
}

@Nullable
private static InputStream resourceAsStream() {
return Versions.class.getClassLoader().getResourceAsStream("version.properties");
}
}

0 comments on commit 6a3a1b4

Please sign in to comment.