Skip to content

Commit

Permalink
sign maven artifacts with sigstore
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Dec 24, 2024
1 parent 88d58ca commit 734f2a3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,18 @@ jobs:
name: Publish Snapshot
runs-on: ubuntu-latest
needs: tests
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
# if: >
# github.event_name == 'push'
# && github.event.repository.fork == false
# && endsWith(github.ref, github.event.repository.default_branch)
permissions:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
egress-policy: audit
allowed-endpoints: >
${{ env.ALLOWED_ENDPOINTS }}
docs.oracle.com:443
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protobuf = "4.29.2"
slf4j = "2.0.16"
slf4j-test = "3.0.1"
snakeyaml = "2.3"
sigstore = "1.2.0"
sonarqube = "6.0.1.5171"
spotbugs = "4.8.6"
spotbugs-contrib = "7.6.9"
Expand Down Expand Up @@ -237,6 +238,7 @@ jmh-report = { id = "io.morethan.jmhreport", version.ref = "jmh-report" }
jvm-dependency-conflict-resolution = { id = "org.gradlex.jvm-dependency-conflict-resolution", version.ref = "jvm-dependency-conflict-resolution" }
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus-publish" }
nullaway = { id = "net.ltgt.nullaway", version.ref = "nullaway-plugin" }
sigstore = { id = "dev.sigstore.sign", version.ref = "sigstore" }
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
spotbugs = { id = "com.github.spotbugs", version.ref = "spotbugs-plugin" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
1 change: 1 addition & 0 deletions gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
implementation(plugin(libs.plugins.bnd))
implementation(plugin(libs.plugins.idea))
implementation(plugin(libs.plugins.nullaway))
implementation(plugin(libs.plugins.sigstore))
implementation(plugin(libs.plugins.spotbugs))
implementation(plugin(libs.plugins.versions))
implementation(plugin(libs.plugins.sonarqube))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("dev.sigstore.sign")
`maven-publish`
`java-library`
signing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ private void demote() {
// nL = nL − 1

policyStats.recordEviction();
requireNonNull(headT2.next);

while (requireNonNull(headT2.next).marked) {
while (headT2.next.marked) {
policyStats.recordOperation();
Node demoted = headT2.next;
Node demoted = requireNonNull(headT2.next);
demoted.marked = false;
demoted.remove();
sizeT2--;
Expand All @@ -257,10 +258,10 @@ private void demote() {
}
}

while ((requireNonNull(headT1.next).filter == FilterType.LONG_TERM)
|| requireNonNull(headT1.next).marked) {
requireNonNull(headT1.next);
while ((headT1.next.filter == FilterType.LONG_TERM) || headT1.next.marked) {
policyStats.recordOperation();
Node node = headT1.next;
Node node = requireNonNull(headT1.next);
if (node.marked) {
node.moveToTail(headT1);
node.marked = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public void record(long key) {
policyStats.recordOperation();
@Var Node node = data.get(key);
if (node != null) {
switch (requireNonNull(node.type)) {
requireNonNull(node.type);
switch (node.type) {
case MAIN:
node.moveToTail(headMain);
policyStats.recordHit();
Expand Down

0 comments on commit 734f2a3

Please sign in to comment.