From 52fb7e5aa4ba9f09ae47eb991dd78e96693722b8 Mon Sep 17 00:00:00 2001 From: Cristian Cotovanu Date: Fri, 18 Oct 2024 20:13:03 +0300 Subject: [PATCH] chore: adhere to jenkins PR standards and automatic release procedure [AUOPS-4287] - add cd github workflow for automatic release with manually controlled prefix (https://www.jenkins.io/doc/developer/publishing/releasing-cd/#update-maven-pom-and-config) - upgrade jenkins version used in Jenkinsfile for CI - enable dependabot (https://www.jenkins.io/doc/developer/publishing/releasing-cd/#update-maven-pom-and-config) - enable incrementals (https://www.jenkins.io/doc/developer/plugin-development/incrementals/) --- .github/dependabot.yml | 12 ++++++++++++ .github/workflows/cd.yaml | 22 ++++++++++++++++++++++ .mvn/extensions.xml | 7 +++++++ .mvn/maven.config | 3 +++ Jenkinsfile | 2 +- pom.xml | 15 +++++++++------ 6 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/cd.yaml create mode 100644 .mvn/extensions.xml create mode 100644 .mvn/maven.config diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d048be62 --- /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/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 00000000..0891e3c9 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,22 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins + +name: cd +on: + workflow_dispatch: + inputs: + validate_only: + required: false + type: boolean + description: | + Run validation with release drafter only + → Skip the release job + default: false + +jobs: + maven-cd: + uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 + with: + validate_only: ${{ inputs.validate_only == true }} + secrets: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 00000000..4e0774d5 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,7 @@ + + + io.jenkins.tools.incrementals + git-changelist-maven-extension + 1.8 + + diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 00000000..61cf4e5e --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1,3 @@ +-Pconsume-incrementals +-Pmight-produce-incrementals +-Dchangelist.format=%d.v%s \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 30834649..4965a79d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ buildPlugin( tests: [skip: true], configurations: [ - [platform: 'windows', jdk: '11', jenkins: '2.361.2'], + [platform: 'windows', jdk: '11', jenkins: '2.414.3'], ] ) diff --git a/pom.xml b/pom.xml index 5e6c4760..50af04c8 100644 --- a/pom.xml +++ b/pom.xml @@ -9,10 +9,13 @@ uipath-automation-package - 4.0-SNAPSHOT + ${revision}.${changelist} hpi + 4.0 + 999999-SNAPSHOT + jenkinsci/uipath-automation-package-plugin 2.414.3 1.7 2.4.0 @@ -212,10 +215,10 @@ - scm:git:ssh://git@github.com/jenkinsci/uipath-automation-package-plugin.git - scm:git:ssh://git@github.com/jenkinsci/uipath-automation-package-plugin.git - https://github.com/jenkinsci/uipath-automation-package-plugin - HEAD + scm:git:ssh://git@github.com/${gitHubRepo}.git + scm:git:ssh://git@github.com/${gitHubRepo}.git + https://github.com/${gitHubRepo} + ${scmTag} @@ -391,7 +394,7 @@ - cotovanu-cristian + cristiancotovanu Cristian Cotovanu https://github.com/cotovanu-cristian cristian.cotovanu@uipath.com