From 637caf6de4090e1a846dd72fd84bb46418591cb6 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 11 Dec 2024 20:58:24 +0100 Subject: [PATCH] chore(updatecli): Update the gson-api plugin version (#447) * Keep the gson-api plugin up-to-date with updatecli Fixes #58 Add `updatecli` manifest to track and update `gson-api` plugin version. * Create `updatecli/updatecli.d/gson-api.yaml` to track the latest `gson-api` plugin release from GitHub. * Define source to track the latest `gson-api` plugin release from `jenkinsci/gson-api-plugin` repository. * Define target to update `plugin-modernizer-core/src/main/resources/META-INF/rewrite/recipes.yml` file with the latest version. * Define actions to create a pull request with the changes. * Modify `.github/workflows/updatecli.yaml` to include a step to run the new `updatecli` manifest file `updatecli/updatecli.d/gson-api.yaml`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/plugin-modernizer-tool/issues/58?shareId=XXXX-XXXX-XXXX-XXXX). * WiP * fix(updatecli): New selector for the yaml path * fix(updatecli): New selector for the yaml path * fix(updatecli): $. * fix(updatecli): Switched from yaml to file. * fix(ga): No need to have anything specific to gson-api --- updatecli/updatecli.d/gson-api.yaml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 updatecli/updatecli.d/gson-api.yaml diff --git a/updatecli/updatecli.d/gson-api.yaml b/updatecli/updatecli.d/gson-api.yaml new file mode 100644 index 00000000..20cc054a --- /dev/null +++ b/updatecli/updatecli.d/gson-api.yaml @@ -0,0 +1,46 @@ +name: Update gson-api plugin version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + latestGsonApiVersion: + kind: githubrelease + spec: + owner: "jenkinsci" + repository: "gson-api-plugin" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versioning: + kind: semver + pattern: "latest" + +targets: + updateRecipesYaml: + name: "Update gson-api plugin version in recipes.yml" + kind: file + spec: + file: ./plugin-modernizer-core/src/main/resources/META-INF/rewrite/recipes.yml + matchPattern: "(pluginArtifactId: gson-api\\n)(.*\\n)(.*pluginVersion:) .*" + replacePattern: '$1$2$3 {{ source "latestGsonApiVersion" }}' + sourceid: latestGsonApiVersion + scmid: default + +actions: + createPullRequest: + kind: github/pullrequest + scmid: default + title: 'Update gson-api plugin version to {{ source "latestGsonApiVersion" }}' + spec: + labels: + - dependencies + - updatecli