mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-09 13:36:56 +02:00
parent
7944b7d721
commit
7cd13c040f
@ -134,7 +134,7 @@ func getDownloadURL(ctx *context.Context, githubURL, file string) string {
|
||||
githubURL,
|
||||
ctx.Config.Release.GitHub.Owner,
|
||||
ctx.Config.Release.GitHub.Name,
|
||||
ctx.Version,
|
||||
ctx.Git.CurrentTag,
|
||||
file,
|
||||
)
|
||||
}
|
||||
|
@ -431,13 +431,47 @@ func Test_getDownloadURL(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
"simple",
|
||||
args{&context.Context{Version: "1.0.0", Config: config.Project{Release: config.Release{GitHub: config.Repo{Owner: "user", Name: "repo"}}}}, "https://github.com", "file.tar.gz"},
|
||||
"https://github.com/user/repo/releases/download/1.0.0/file.tar.gz",
|
||||
args{
|
||||
&context.Context{
|
||||
Version: "1.0.0",
|
||||
Git: context.GitInfo{
|
||||
CurrentTag: "v1.0.0",
|
||||
},
|
||||
Config: config.Project{
|
||||
Release: config.Release{
|
||||
GitHub: config.Repo{
|
||||
Owner: "user",
|
||||
Name: "repo",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"https://github.com",
|
||||
"file.tar.gz",
|
||||
},
|
||||
"https://github.com/user/repo/releases/download/v1.0.0/file.tar.gz",
|
||||
},
|
||||
{
|
||||
"custom",
|
||||
args{&context.Context{Version: "1.0.0", Config: config.Project{Release: config.Release{GitHub: config.Repo{Owner: "user", Name: "repo"}}}}, "https://git.my.company.com", "file.tar.gz"},
|
||||
"https://git.my.company.com/user/repo/releases/download/1.0.0/file.tar.gz",
|
||||
args{
|
||||
&context.Context{
|
||||
Version: "1.0.0",
|
||||
Git: context.GitInfo{
|
||||
CurrentTag: "v1.0.0",
|
||||
},
|
||||
Config: config.Project{
|
||||
Release: config.Release{
|
||||
GitHub: config.Repo{
|
||||
Owner: "user",
|
||||
Name: "repo",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"https://git.my.company.com",
|
||||
"file.tar.gz",
|
||||
},
|
||||
"https://git.my.company.com/user/repo/releases/download/v1.0.0/file.tar.gz",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
@ -2,11 +2,11 @@
|
||||
"version": "1.0.1",
|
||||
"architecture": {
|
||||
"32bit": {
|
||||
"url": "https://github.com/test/test/releases/download/1.0.1/foo_1.0.1_windows_386.tar.gz",
|
||||
"url": "https://github.com/test/test/releases/download/v1.0.1/foo_1.0.1_windows_386.tar.gz",
|
||||
"bin": "test.exe"
|
||||
},
|
||||
"64bit": {
|
||||
"url": "https://github.com/test/test/releases/download/1.0.1/foo_1.0.1_windows_amd64.tar.gz",
|
||||
"url": "https://github.com/test/test/releases/download/v1.0.1/foo_1.0.1_windows_amd64.tar.gz",
|
||||
"bin": "test.exe"
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user