1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-05 00:59:04 +02:00

refactor: align Homebrew repo handling with Scoop (#1649)

This commit is contained in:
Radek Simko
2020-07-06 14:48:17 +01:00
committed by GitHub
parent 345b91703a
commit 998e377627
28 changed files with 311 additions and 264 deletions

View File

@ -2,6 +2,7 @@ package client
import (
"crypto/tls"
"fmt"
"net/http"
"net/url"
"os"
@ -17,6 +18,8 @@ import (
"golang.org/x/oauth2"
)
const DefaultGitHubDownloadURL = "https://github.com"
type githubClient struct {
client *github.Client
}
@ -147,6 +150,15 @@ func (c *githubClient) CreateRelease(ctx *context.Context, body string) (string,
return githubReleaseID, err
}
func (c *githubClient) ReleaseURLTemplate(ctx *context.Context) (string, error) {
return fmt.Sprintf(
"%s/%s/%s/releases/download/{{ .Tag }}/{{ .ArtifactName }}",
ctx.Config.GitHubURLs.Download,
ctx.Config.Release.GitHub.Owner,
ctx.Config.Release.GitHub.Name,
), nil
}
func (c *githubClient) Upload(
ctx *context.Context,
releaseID string,