Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Apr 21, 2021
2 parents e38f407 + 7a7a6f6 commit 7303dc4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/caarlos0/go-shellwords v1.0.12
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e
github.com/fatih/color v1.10.0
github.com/google/go-github/v28 v28.1.1
github.com/google/go-github/v35 v35.0.1-0.20210421135231-b235769d1606
github.com/goreleaser/fileglob v1.2.0
github.com/goreleaser/nfpm/v2 v2.4.0
github.com/imdario/mergo v0.3.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v28 v28.1.1 h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v35 v35.0.1-0.20210421135231-b235769d1606 h1:+8mvMVu+3yXBi/HdWq39mWbt/60u9qS+dkVZfjqEnt8=
github.com/google/go-github/v35 v35.0.1-0.20210421135231-b235769d1606/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-replayers/grpcreplay v1.0.0 h1:B5kVOzJ1hBgnevTgIWhSTatQ3608yu/2NnU0Ta1d0kY=
Expand Down
17 changes: 8 additions & 9 deletions internal/client/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"

"github.com/apex/log"
"github.com/google/go-github/v28/github"
"github.com/google/go-github/v35/github"
"github.com/goreleaser/goreleaser/internal/artifact"
"github.com/goreleaser/goreleaser/internal/tmpl"
"github.com/goreleaser/goreleaser/pkg/config"
Expand Down Expand Up @@ -60,7 +60,6 @@ func NewGitHub(ctx *context.Context, token string) (Client, error) {
// CloseMilestone closes a given milestone.
func (c *githubClient) CloseMilestone(ctx *context.Context, repo Repo, title string) error {
milestone, err := c.getMilestoneByTitle(ctx, repo, title)

if err != nil {
return err
}
Expand Down Expand Up @@ -139,12 +138,13 @@ func (c *githubClient) CreateRelease(ctx *context.Context, body string) (string,
return "", err
}

var data = &github.RepositoryRelease{
Name: github.String(title),
TagName: github.String(ctx.Git.CurrentTag),
Body: github.String(body),
Draft: github.Bool(ctx.Config.Release.Draft),
Prerelease: github.Bool(ctx.PreRelease),
data := &github.RepositoryRelease{
Name: github.String(title),
TagName: github.String(ctx.Git.CurrentTag),
Body: github.String(body),
Draft: github.Bool(ctx.Config.Release.Draft),
Prerelease: github.Bool(ctx.PreRelease),
DiscussionCategoryName: github.String(ctx.Config.Release.DiscussionCategoryName),
}
release, _, err = c.client.Repositories.GetReleaseByTag(
ctx,
Expand Down Expand Up @@ -229,7 +229,6 @@ func (c *githubClient) getMilestoneByTitle(ctx *context.Context, repo Repo, titl
repo.Name,
opts,
)

if err != nil {
return nil, err
}
Expand Down
19 changes: 10 additions & 9 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,16 @@ type Archive struct {

// Release config used for the GitHub/GitLab release.
type Release struct {
GitHub Repo `yaml:",omitempty"`
GitLab Repo `yaml:",omitempty"`
Gitea Repo `yaml:",omitempty"`
Draft bool `yaml:",omitempty"`
Disable bool `yaml:",omitempty"`
Prerelease string `yaml:",omitempty"`
NameTemplate string `yaml:"name_template,omitempty"`
IDs []string `yaml:"ids,omitempty"`
ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"`
GitHub Repo `yaml:",omitempty"`
GitLab Repo `yaml:",omitempty"`
Gitea Repo `yaml:",omitempty"`
Draft bool `yaml:",omitempty"`
Disable bool `yaml:",omitempty"`
Prerelease string `yaml:",omitempty"`
NameTemplate string `yaml:"name_template,omitempty"`
IDs []string `yaml:"ids,omitempty"`
ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"`
DiscussionCategoryName string `yaml:"discussion_category_name,omitempty"`
}

// Milestone config used for VCS milestone.
Expand Down
4 changes: 4 additions & 0 deletions www/docs/customization/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ release:
# Default is false.
draft: true

# If set, will create a release discussion in the category specified.
# Default is empty.
discussion_category_name: General

# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
Expand Down

0 comments on commit 7303dc4

Please sign in to comment.