From ee708e2fc8cb2af728e1f792e399febcc8219ece Mon Sep 17 00:00:00 2001 From: AldenPratt Date: Fri, 27 Oct 2023 10:22:36 -0400 Subject: [PATCH 1/4] Setting up CD Needed for convenience plugin releases. --- .github/dependabot.yml | 12 ++++++++++++ .github/release-drafter.yml | 4 ---- .github/workflows/cd.yaml | 15 +++++++++++++++ .github/workflows/release-drafter.yml | 17 ----------------- .mvn/maven.config | 1 + 5 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/cd.yaml delete mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c0055119 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates + +version: 2 +updates: +- package-ecosystem: maven + directory: / + schedule: + interval: monthly +- package-ecosystem: github-actions + directory: / + schedule: + interval: monthly \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 9d3c546c..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,4 +0,0 @@ -_extends: .github -name-template: "v$NEXT_PATCH_VERSION 🌈" -tag-template: "accurev-$NEXT_PATCH_VERSION" -version-template: "$MAJOR.$MINOR.$PATCH" diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 00000000..64a6693f --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,15 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins + +name: cd +on: + workflow_dispatch: + check_run: + types: + - completed + +jobs: + maven-cd: + uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 + secrets: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index f87134b2..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Note: additional setup is required, see https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc - -name: Release Drafter - -on: - push: - branches: - - master - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into the default branch - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mvn/maven.config b/.mvn/maven.config index 2a0299c4..61cf4e5e 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1,2 +1,3 @@ -Pconsume-incrementals -Pmight-produce-incrementals +-Dchangelist.format=%d.v%s \ No newline at end of file From 6c853073c254e5d79f71398bb2fb18588d18dc8d Mon Sep 17 00:00:00 2001 From: AldenPratt Date: Sat, 28 Oct 2023 20:57:17 -0400 Subject: [PATCH 2/4] updaing maven strategy matrix --- .github/workflows/maven.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2f732635..0daf6e6e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -8,15 +8,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - java: [1.8, 11] - jenkins-version: [2.138.4, 2.190.1] + java: [11] + jenkins-version: [2.361] os: [ubuntu-latest, windows-latest] - include: - - jenkins-version: '2.190.1' - flags: '--define jenkins.version=2.190.1 --define slf4jVersion=1.7.26' - exclude: - - java: '11' - jenkins-version: '2.138.4' steps: - uses: actions/checkout@v1 From 15f8a275af7f8c695a76badef28bb9e94621cc6a Mon Sep 17 00:00:00 2001 From: AldenPratt Date: Sat, 28 Oct 2023 20:57:52 -0400 Subject: [PATCH 3/4] Fixing spotbug finding --- .../java/jenkins/plugins/accurev/AccurevTool.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/jenkins/plugins/accurev/AccurevTool.java b/src/main/java/jenkins/plugins/accurev/AccurevTool.java index fc42edb6..9ea83647 100644 --- a/src/main/java/jenkins/plugins/accurev/AccurevTool.java +++ b/src/main/java/jenkins/plugins/accurev/AccurevTool.java @@ -47,13 +47,12 @@ public AccurevTool(String name, String home, List> pro } private static AccurevTool[] getInstallations(DescriptorImpl descriptor) { - AccurevTool[] installations; - try { - installations = descriptor.getInstallations(); - } catch (NullPointerException e) { - installations = new AccurevTool[0]; + + if (descriptor == null) { + return new AccurevTool[0]; + } else { + return descriptor.getInstallations(); } - return installations; } /** From 2de728ca3bd910997ab40291e51e6419691a443f Mon Sep 17 00:00:00 2001 From: AldenPratt Date: Sat, 28 Oct 2023 21:03:45 -0400 Subject: [PATCH 4/4] update Jenkins version and remove Java 8 config --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80ffecf0..7eca35f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,9 @@ #!/usr/bin/env groovy /* `buildPlugin` step provided by: https://github.com/jenkins-infra/pipeline-library */ -def recentLTS = "2.176.4" +def recentLTS = "2.361" def configurations = [ - [ platform: "linux", jdk: "8", jenkins: null ], - [ platform: "linux", jdk: "8", jenkins: recentLTS ], [ platform: "linux", jdk: "11", jenkins: recentLTS ], - [ platform: "windows", jdk: "8", jenkins: null ], - [ platform: "windows", jdk: "8", jenkins: recentLTS ], [ platform: "windows", jdk: "11", jenkins: recentLTS ], ] buildPlugin(configurations: configurations)