Skip to content

Commit

Permalink
chore(updatecli): Update the gson-api plugin version (#447)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gounthar authored Dec 11, 2024
1 parent 38c1672 commit 637caf6
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions updatecli/updatecli.d/gson-api.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 637caf6

Please sign in to comment.