1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

fix: scoop download url (#594)

closes #593
This commit is contained in:
Carlos Alexandro Becker 2018-03-05 20:55:02 -03:00 committed by GitHub
parent 7944b7d721
commit 7cd13c040f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 7 deletions

View File

@ -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,
)
}

View 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 {

View File

@ -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"
}
},