1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

feat(winget): PortableCommandAlias (#4196)

needs #4195

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-07-18 16:43:36 -03:00 committed by GitHub
parent 00bc248c1b
commit 7a2fc10625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 26 additions and 2 deletions

View File

@ -67,7 +67,8 @@ type Version struct {
// nolint: tagliatelle
type InstallerItemFile struct {
RelativeFilePath string `yaml:"RelativeFilePath,omitempty"`
RelativeFilePath string `yaml:"RelativeFilePath,omitempty"`
PortableCommandAlias string `yaml:"PortableCommandAlias,omitempty"`
}
// nolint: tagliatelle

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -10,6 +10,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo\bin\foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_amd64v1.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -17,6 +18,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo\bin\foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_386.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious
@ -24,6 +26,7 @@ Installers:
NestedInstallerType: portable
NestedInstallerFiles:
- RelativeFilePath: foo\bin\foo.exe
PortableCommandAlias: foo
InstallerUrl: https://dummyhost/download/v1.2.1/foo_windows_arm64.zip
InstallerSha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
UpgradeBehavior: uninstallPrevious

View File

@ -224,7 +224,8 @@ func (p Pipe) doRun(ctx *context.Context, winget config.Winget, cl client.Releas
folder := artifact.ExtraOr(*archive, artifact.ExtraWrappedIn, ".")
for _, bin := range artifact.ExtraOr(*archive, artifact.ExtraBinaries, []string{}) {
files = append(files, InstallerItemFile{
RelativeFilePath: strings.ReplaceAll(filepath.Join(folder, bin), "/", "\\"),
RelativeFilePath: strings.ReplaceAll(filepath.Join(folder, bin), "/", "\\"),
PortableCommandAlias: strings.TrimSuffix(filepath.Base(bin), ".exe"),
})
}
url, err := tmpl.New(ctx).WithArtifact(archive).Apply(winget.URLTemplate)