From 433e139b49171a03ab2f4cc9a5b2c5e8defa703c Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 1 Oct 2021 21:03:12 +0100 Subject: [PATCH 1/3] enable CD for the repository --- .github/release-drafter.yml | 4 --- .github/workflows/cd.yaml | 59 +++++++++++++++++++++++++++++++++++++ pom.xml | 4 +-- 3 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/cd.yaml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 549643b..0d0b1c9 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1 @@ -# https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc _extends: .github -version-template: $MAJOR.$MINOR.$PATCH -tag-template: jackson2-api-$NEXT_PATCH_VERSION -name-template: $NEXT_PATCH_VERSION diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..91a52f1 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,59 @@ +# 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: + validate: + runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }} + steps: + - name: Verify CI status + uses: jenkins-infra/verify-ci-status-action@v1.2.0 + id: verify-ci-status + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + output_result: true + + - name: Release Drafter + uses: release-drafter/release-drafter@v5 + if: steps.verify-ci-status.outputs.result == 'success' + with: + name: next + tag: next + version: next + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check interesting categories + uses: jenkins-infra/interesting-category-action@v1.0.0 + id: interesting-categories + if: steps.verify-ci-status.outputs.result == 'success' + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + runs-on: ubuntu-latest + needs: [validate] + if: needs.validate.outputs.should_release == 'true' + steps: + - name: Check out + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 8 + - name: Release + uses: jenkins-infra/jenkins-maven-cd-action@v1.1.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index b896343..c6b7161 100644 --- a/pom.xml +++ b/pom.xml @@ -64,11 +64,11 @@ - 2.12.4-2 + 2.12.4 -SNAPSHOT 8 2.249.1 - 2.12.4 + ${revision} ${jackson.version} From 4af2a67a5327560e768133b9886b2de1ceb97c3b Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 1 Oct 2021 21:15:19 +0100 Subject: [PATCH 2/3] tweak the version and add missing property @timja pointed out that a few things where not quite as documented. Better to stay on the happy path :) --- .mvn/maven.config | 1 + pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mvn/maven.config b/.mvn/maven.config index 2a0299c..61cf4e5 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 diff --git a/pom.xml b/pom.xml index c6b7161..fcfae96 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ jackson2-api - ${revision}${changelist} + ${revision}-${changelist} hpi Jackson 2 API Plugin @@ -65,7 +65,7 @@ 2.12.4 - -SNAPSHOT + 999999-SNAPSHOT 8 2.249.1 ${revision} From ae441939f7bc3d985867e53ca6486f9599f40b19 Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 1 Oct 2021 21:19:34 +0100 Subject: [PATCH 3/3] Update .github/workflows/cd.yaml Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 91a52f1..d807549 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -52,7 +52,7 @@ jobs: distribution: 'adopt' java-version: 8 - name: Release - uses: jenkins-infra/jenkins-maven-cd-action@v1.1.0 + uses: jenkins-infra/jenkins-maven-cd-action@v1.2.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}