From 1f9a6ae0fc0e88cc4ef7db33a94ff1cf14496cdb Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Wed, 25 Dec 2024 10:47:14 -0800 Subject: [PATCH] use sigstore only when publishing via github actions --- .../main/kotlin/lifecycle/publish.caffeine.gradle.kts | 10 +++++++++- .../caffeine/jcache/processor/EntryProcessorTest.java | 4 +++- jitpack.yml | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gradle/plugins/src/main/kotlin/lifecycle/publish.caffeine.gradle.kts b/gradle/plugins/src/main/kotlin/lifecycle/publish.caffeine.gradle.kts index 437960f4b5..935af68726 100644 --- a/gradle/plugins/src/main/kotlin/lifecycle/publish.caffeine.gradle.kts +++ b/gradle/plugins/src/main/kotlin/lifecycle/publish.caffeine.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("dev.sigstore.sign") + id("dev.sigstore.sign-base") apply false `maven-publish` `java-library` signing @@ -73,3 +73,11 @@ signing { tasks.withType().configureEach { incompatibleWithConfigurationCache() } + +if (!System.getenv("ACTIONS_ID_TOKEN_REQUEST_URL").isNullOrEmpty()) { + publishing { + sigstoreSign { + sign(publications = publishing.publications) + } + } +} diff --git a/jcache/src/test/java/com/github/benmanes/caffeine/jcache/processor/EntryProcessorTest.java b/jcache/src/test/java/com/github/benmanes/caffeine/jcache/processor/EntryProcessorTest.java index ac9bf03a1f..50ad555ae7 100644 --- a/jcache/src/test/java/com/github/benmanes/caffeine/jcache/processor/EntryProcessorTest.java +++ b/jcache/src/test/java/com/github/benmanes/caffeine/jcache/processor/EntryProcessorTest.java @@ -18,6 +18,7 @@ import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static com.google.common.truth.Truth.assertThat; +import static java.util.Objects.requireNonNull; import static java.util.function.Function.identity; import static javax.cache.expiry.Duration.FIVE_MINUTES; @@ -141,7 +142,8 @@ final class MapLoader implements CacheLoader { return map.get(key); } @Override public ImmutableMap loadAll(Iterable keys) { - return Streams.stream(keys).collect(toImmutableMap(identity(), this::load)); + return Streams.stream(keys).collect( + toImmutableMap(identity(), key -> requireNonNull(load(key)))); } } } diff --git a/jitpack.yml b/jitpack.yml index b4da4048f1..a2c1f3d7b8 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ before_install: - source "$HOME/.sdkman/bin/sdkman-init.sh" - sdk update - - sdk install java 21.0.3-zulu - - sdk use java 21.0.3-zulu + - sdk install java 21.0.5-zulu + - sdk use java 21.0.5-zulu