You've already forked goreleaser
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user