From 7a6630f7ccee30880dc6dc8eabb6a5fb0964e73a Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 7 Aug 2026 08:23:21 -0600 Subject: [PATCH] Enable automated release with JEP-229 https://www.jenkins.io/doc/developer/publishing/releasing-cd Testing done: * Confirmed the output from: mvn validate help:evaluate -Dexpression=project.version mvn validate help:evaluate -Dexpression=project.version -Dset.changelist -Dignore.dirt --- .github/release-drafter.yml | 5 --- .github/workflows/cd.yaml | 54 +++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 30 --------------- .mvn/maven.config | 1 + pom.xml | 5 +-- 5 files changed, 57 insertions(+), 38 deletions(-) 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/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 3ede951e..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,5 +0,0 @@ -# see https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc -_extends: github:jenkinsci/.github:/.github/release-drafter.yml -version-template: $MAJOR.$MINOR.$PATCH -name-template: $NEXT_PATCH_VERSION -tag-template: plot-$NEXT_PATCH_VERSION diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 00000000..9b134d5c --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,54 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins +# +# Please find additional hints for individual trigger use case +# configuration options inline this script below. +# +--- +name: cd +on: + workflow_dispatch: + inputs: + validate_only: + required: false + type: boolean + description: | + Run validation with release drafter only + → Skip the release job + # Note: Change this default to true, + # if the checkbox should be checked by default. + default: false + # If you don't want any automatic trigger in general, then + # the following check_run trigger lines should all be commented. + # Note: Consider the use case #2 config for 'validate_only' below + # as an alternative option! + check_run: + types: + - completed + +permissions: + checks: read + contents: write + +jobs: + maven-cd: + uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 + with: + # Comment / uncomment the validate_only config appropriate to your preference: + # + # Use case #1 (automatic release): + # - Let any successful Jenkins build trigger another release, + # if there are merged pull requests of interest + # - Perform a validation only run with drafting a release note, + # if manually triggered AND inputs.validate_only has been checked. + # + validate_only: ${{ inputs.validate_only == true }} + # + # Alternative use case #2 (no automatic release): + # - Same as use case #1 - but: + # - Let any check_run trigger a validate_only run. + # => enforce the release job to be skipped. + # + #validate_only: ${{ inputs.validate_only == true || github.event_name == 'check_run' }} + secrets: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 116b35ac..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Automates creation of Release Drafts using Release Drafter -# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc ---- -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - master - -permissions: - contents: write - pull-requests: write - -jobs: - update_release_draft: - # Only draft release notes on the repo in the jenkinsci GitHub organization - if: ${{ github.repository_owner == 'jenkinsci' }} - runs-on: ubuntu-latest - steps: - # https://github.com/release-drafter/release-drafter/issues/871#issuecomment-3686135188 - - name: Wait for 15 seconds to ensure GraphQL consistency - shell: bash - run: sleep 15s - # Drafts your next Release notes as Pull Requests are merged into the default branch - - name: Release Drafter - uses: release-drafter/release-drafter@34d80673e067bdc0c24568d3af899c216adcfaa9 # v7.7.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mvn/maven.config b/.mvn/maven.config index 2a0299c4..f7daf60d 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1,2 +1,3 @@ -Pconsume-incrementals -Pmight-produce-incrementals +-Dchangelist.format=%d.v%s diff --git a/pom.xml b/pom.xml index 56d8626f..b793b830 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ plot - ${revision}${changelist} + ${changelist} hpi Plot plugin https://github.com/jenkinsci/plot-plugin @@ -23,8 +23,7 @@ - 2.4.1 - -SNAPSHOT + 999999-SNAPSHOT jenkinsci/plot-plugin commons-collections4,opencsv true