Skip to content

Commit 20cd918

Browse files
authored
chore: handle toolhive upgrade using renovate (#1257)
* chore: handle toolhive version through renovate * chore: remove bin before upgrade it * chore: run thv fetch and generate clients after upgrade thv * chore: replace rm -rf with rimraf * format
1 parent eb263f8 commit 20cd918

File tree

4 files changed

+121
-1
lines changed

4 files changed

+121
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"publish": "electron-forge publish",
2020
"type-check": "tsc --noEmit -p ./tsconfig.app.json && tsc --noEmit -p ./tsconfig.node.json",
2121
"prepare": "husky install",
22-
"thv": "ts-node ./utils/fetch-thv.ts --run",
22+
"thv": "rimraf bin/ && ts-node ./utils/fetch-thv.ts --run",
2323
"test": "vitest",
2424
"test:nonInteractive": "vitest run",
2525
"test:coverage": "vitest run --coverage",
@@ -82,6 +82,7 @@
8282
"prettier-plugin-classnames": "^0.8.0",
8383
"prettier-plugin-merge": "^0.8.0",
8484
"prettier-plugin-tailwindcss": "^0.7.0",
85+
"rimraf": "^6.1.0",
8586
"tar": "^7.5.2",
8687
"ts-node": "^10.9.2",
8788
"typescript": "5.9.3",

pnpm-lock.yaml

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renovate.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
"matchPackageNames": ["ghcr.io/stackloklabs/mcp-optimizer"],
1212
"prPriority": 10,
1313
"schedule": []
14+
},
15+
{
16+
"matchDatasources": ["github-releases"],
17+
"matchPackageNames": ["stacklok/toolhive"],
18+
"prPriority": 10,
19+
"schedule": [],
20+
"postUpgradeTasks": {
21+
"commands": ["pnpm run thv", "pnpm run generate-client"],
22+
"fileFilters": ["bin/**", "api/generated/**"],
23+
"executionMode": "update"
24+
}
1425
}
1526
],
1627
"customManagers": [
@@ -23,6 +34,16 @@
2334
"datasourceTemplate": "{{datasource}}",
2435
"depNameTemplate": "{{depName}}",
2536
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}docker{{/if}}"
37+
},
38+
{
39+
"customType": "regex",
40+
"fileMatch": ["^utils/constants\\.ts$"],
41+
"matchStrings": [
42+
"renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)(?: versioning=(?<versioning>\\S+))?\\s*\\*/\\s*export const TOOLHIVE_VERSION = process\\.env\\.THV_VERSION \\?\\? '(?<currentValue>.*?)'"
43+
],
44+
"datasourceTemplate": "{{datasource}}",
45+
"depNameTemplate": "{{depName}}",
46+
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
2647
}
2748
]
2849
}

utils/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
/**
2+
* ToolHive CLI version.
3+
* This is managed by Renovate and updated automatically when new versions are released.
4+
* renovate: datasource=github-releases depName=stacklok/toolhive versioning=semver
5+
*/
16
export const TOOLHIVE_VERSION = process.env.THV_VERSION ?? 'v0.6.2'

0 commit comments

Comments
 (0)