Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(manager/asdf): Support gohugo plugin including extended_ version #18987

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/modules/manager/asdf/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ elixir 1.14.1
elm 0.19.1
erlang 25.1.2
gauche 0.9.12
gohugo extended_0.104.3
golang 1.19.2
haskell 9.4.2
helm 3.10.1
Expand Down Expand Up @@ -180,6 +181,14 @@ dummy 1.2.3
versioning: 'semver',
depName: 'gauche',
},
{
currentValue: '0.104.3',
datasource: 'github-releases',
packageName: 'gohugoio/hugo',
versioning: 'semver',
depName: 'gohugo',
extractVersion: '^v(?<version>\\S+)',
},
{
currentValue: '1.19.2',
datasource: 'github-tags',
Expand Down
36 changes: 23 additions & 13 deletions lib/modules/manager/asdf/upgradeable-tooling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,27 @@ export type StaticTooling = Partial<PackageDependency> &

export type DynamicTooling = (version: string) => StaticTooling | undefined;

export const upgradeableTooling: Record<
string,
{ config: StaticTooling | DynamicTooling; asdfPluginUrl: string }
> = {
export type ToolingConfig = StaticTooling | DynamicTooling;
export interface ToolingDefinition {
config: ToolingConfig;
asdfPluginUrl: string;
}

const hugoDefinition: ToolingDefinition = {
// This plugin supports the names `hugo` & `gohugo`
asdfPluginUrl: 'https://github.com/NeoHsu/asdf-hugo',
config: (version) => ({
datasource: GithubReleasesDatasource.id,
packageName: 'gohugoio/hugo',
versioning: semverVersioning.id,
extractVersion: '^v(?<version>\\S+)',
// The asdf hugo plugin supports prefixing the version with
// `extended_`. Extended versions feature Sass support.
currentValue: version.replace(/^extended_/, ''),
}),
};

export const upgradeableTooling: Record<string, ToolingDefinition> = {
awscli: {
asdfPluginUrl: 'https://github.com/MetricMike/asdf-awscli',
config: {
Expand Down Expand Up @@ -121,6 +138,7 @@ export const upgradeableTooling: Record<
versioning: semverVersioning.id,
},
},
gohugo: hugoDefinition,
golang: {
asdfPluginUrl: 'https://github.com/kennyp/asdf-golang',
config: {
Expand Down Expand Up @@ -157,15 +175,7 @@ export const upgradeableTooling: Record<
extractVersion: '^v(?<version>\\S+)',
},
},
hugo: {
asdfPluginUrl: 'https://github.com/NeoHsu/asdf-hugo',
config: {
datasource: GithubReleasesDatasource.id,
packageName: 'gohugoio/hugo',
versioning: semverVersioning.id,
extractVersion: '^v(?<version>\\S+)',
},
},
hugo: hugoDefinition,
idris: {
asdfPluginUrl: 'https://github.com/asdf-community/asdf-idris',
config: {
Expand Down