Repository: goreleaser/goreleaser
Pull request #2799 (2021-12-30 12:49:55)

feat(deps): update github.com/caarlos0/env/v6 from v6.8.0 to v6.9.1
env is now dependency-free, and 6.9.1 also has a fix for something we don't use (anonymous inner structs with envPrefix), but anyway, here we go :) 

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2799](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (1b2bc7e) into [main](https://codecov.io/gh/goreleaser/goreleaser/commit/cdcaf038c840247531576a8dd50f30e1615a988c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (cdcaf03) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2799/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@           Coverage Diff           @@
##             main    #2799   +/-   ##
=======================================
  Coverage   84.94%   84.94%           
=======================================
  Files         106      106           
  Lines        8237     8237           
=======================================
  Hits         6997     6997           
  Misses       1010     1010           
  Partials      230      230           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [cdcaf03...1b2bc7e](https://codecov.io/gh/goreleaser/goreleaser/pull/2799?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/USERS.md b/USERS.md
index 6cc1945a..9d21676e 100644
--- a/USERS.md
+++ b/USERS.md
@@ -29,12 +29,14 @@ Here's a running list of some organizations using GoReleaser[^1]:
 1. [Numary](https://numary.com)
 1. [Planetscale](https://planetscale.com)
 1. [Pulumi](https://pulumi.com)
+1. [prestd](https://prestd.com)
 1. [Schwarz IT](https://jobs.schwarz)
 1. [SemaphoreCI](https://semaphoreci.com)
 1. [Sigstore](https://sigstore.dev)
 1. [Splunk](http://dev.splunk.com)
 1. [Sysdig](https://sysdig.com)
 1. [TOTVS Labs](https://totvslabs.com)
+1. [Trybe](https://betrybe.com)
 
 Feel free to [add yours](https://github.com/goreleaser/goreleaser/edit/main/USERS.md)!
 
diff --git a/go.mod b/go.mod
index aeefca2c..e4cc2ecc 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
 	github.com/apex/log v1.9.0
 	github.com/atc0005/go-teams-notify/v2 v2.6.0
 	github.com/caarlos0/ctrlc v1.0.0
-	github.com/caarlos0/env/v6 v6.8.0
+	github.com/caarlos0/env/v6 v6.9.1
 	github.com/caarlos0/go-shellwords v1.0.12
 	github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb
 	github.com/dghubble/oauth1 v0.7.0
@@ -26,7 +26,7 @@ require (
 	github.com/spf13/cobra v1.3.0
 	github.com/stretchr/testify v1.7.0
 	github.com/ulikunitz/xz v0.5.10
-	github.com/vartanbeno/go-reddit/v2 v2.0.1
+	github.com/vartanbeno/go-reddit/v2 v2.0.0
 	github.com/xanzy/go-gitlab v0.52.2
 	gocloud.dev v0.24.0
 	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
diff --git a/go.sum b/go.sum
index e419229a..3f7df836 100644
--- a/go.sum
+++ b/go.sum
@@ -245,8 +245,8 @@ github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4
 github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
 github.com/caarlos0/ctrlc v1.0.0 h1:2DtF8GSIcajgffDFJzyG15vO+1PuBWOMUdFut7NnXhw=
 github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
-github.com/caarlos0/env/v6 v6.8.0 h1:abF9JinEXaibthiOowf4uSnRBWN66aJOxSpHLH67jeI=
-github.com/caarlos0/env/v6 v6.8.0/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0=
+github.com/caarlos0/env/v6 v6.9.1 h1:zOkkjM0F6ltnQ5eBX6IPI41UP/KDGEK7rRPwGCNos8k=
+github.com/caarlos0/env/v6 v6.9.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5Zu0ddvwc=
 github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11 h1:IRrDwVlWQr6kS1U8/EtyA1+EHcc4yl8pndcqXWrEamg=
 github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0=
 github.com/caarlos0/go-shellwords v1.0.12 h1:HWrUnu6lGbWfrDcFiHcZiwOLzHWjjrPVehULaTFgPp8=
@@ -612,9 +612,8 @@ github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc8
 github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
+github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
 github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
-github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
-github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
 github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -775,8 +774,8 @@ github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oW
 github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
 github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
 github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
-github.com/vartanbeno/go-reddit/v2 v2.0.1 h1:P6ITpf5YHjdy7DHZIbUIDn/iNAoGcEoDQnMa+L4vutw=
-github.com/vartanbeno/go-reddit/v2 v2.0.1/go.mod h1:758/S10hwZSLm43NPtwoNQdZFSg3sjB5745Mwjb0ANI=
+github.com/vartanbeno/go-reddit/v2 v2.0.0 h1:fxYMqx5lhbmJ3yYRN1nnQC/gecRB3xpUS2BbG7GLpsk=
+github.com/vartanbeno/go-reddit/v2 v2.0.0/go.mod h1:758/S10hwZSLm43NPtwoNQdZFSg3sjB5745Mwjb0ANI=
 github.com/xanzy/go-gitlab v0.52.2 h1:gkgg1z4ON70sphibtD86Bfmt1qV3mZ0pU0CBBCFAEvQ=
 github.com/xanzy/go-gitlab v0.52.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE=
 github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
diff --git a/internal/pipe/artifacts/artifacts.go b/internal/pipe/artifacts/artifacts.go
index 6a657d4e..695558ce 100644
--- a/internal/pipe/artifacts/artifacts.go
+++ b/internal/pipe/artifacts/artifacts.go
@@ -24,5 +24,5 @@ func (Pipe) Run(ctx *context.Context) error {
 	}
 	path := filepath.Join(ctx.Config.Dist, "artifacts.json")
 	log.Log.WithField("file", path).Info("writing")
-	return os.WriteFile(path, bts, 0o600)
+	return os.WriteFile(path, bts, 0o644)
 }
diff --git a/internal/pipe/changelog/changelog.go b/internal/pipe/changelog/changelog.go
index f7d37d16..84bb28f9 100644
--- a/internal/pipe/changelog/changelog.go
+++ b/internal/pipe/changelog/changelog.go
@@ -72,7 +72,9 @@ func (Pipe) Run(ctx *context.Context) error {
 		"## Changelog",
 	}
 
-	if shouldGroup(ctx.Config.Changelog) {
+	if ctx.Config.Changelog.Use == "github-native" {
+		changelogElements = []string{strings.Join(entries, changelogStringJoiner)}
+	} else if shouldGroup(ctx.Config.Changelog) {
 		log.Debug("grouping entries")
 		groups := ctx.Config.Changelog.Groups
 
diff --git a/internal/pipe/defaults/defaults.go b/internal/pipe/defaults/defaults.go
index d23ce7ba..4bdfeb1c 100644
--- a/internal/pipe/defaults/defaults.go
+++ b/internal/pipe/defaults/defaults.go
@@ -8,7 +8,6 @@ import (
 
 	"github.com/goreleaser/goreleaser/internal/client"
 	"github.com/goreleaser/goreleaser/internal/middleware/errhandler"
-	"github.com/goreleaser/goreleaser/internal/middleware/logging"
 	"github.com/goreleaser/goreleaser/internal/tmpl"
 	"github.com/goreleaser/goreleaser/pkg/context"
 	"github.com/goreleaser/goreleaser/pkg/defaults"
@@ -39,11 +38,7 @@ func (Pipe) Run(ctx *context.Context) error {
 		ctx.Config.GiteaURLs.Download = strings.ReplaceAll(apiURL, "/api/v1", "")
 	}
 	for _, defaulter := range defaults.Defaulters {
-		if err := logging.Log(
-			defaulter.String(),
-			errhandler.Handle(defaulter.Default),
-			logging.ExtraPadding,
-		)(ctx); err != nil {
+		if err := errhandler.Handle(defaulter.Default)(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/www/docs/cookbooks/goreleaser-xx.md b/www/docs/cookbooks/goreleaser-xx.md
new file mode 100644
index 00000000..625d7e17
--- /dev/null
+++ b/www/docs/cookbooks/goreleaser-xx.md
@@ -0,0 +1,17 @@
+# GoReleaser XX
+
+[`goreleaser-xx`](https://github.com/crazy-max/goreleaser-xx#readme) is a small
+CLI wrapper for GoReleaser and available as a [lightweight and multi-platform scratch Docker image](https://hub.docker.com/r/crazymax/goreleaser-xx/tags?page=1&ordering=last_updated)
+to ease the integration and cross compilation in a Dockerfile for your Go
+projects using [Buildx](https://github.com/docker/buildx) Docker component that
+enables many powerful build features with [Moby BuildKit](https://github.com/moby/buildkit)
+builder engine.
+
+* Handle `--platform` in your Dockerfile for multi-platform support
+* Build into any architecture
+* Handle C and C++ compilers for [CGO dependencies](https://github.com/crazy-max/goreleaser-xx#cgo)
+* Translation of [platform ARGs in the global scope](https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope) into Go compiler's target
+* Auto generation of `.goreleaser.yml` config based on target architecture
+
+Many examples are provided in the [`demo` folder](https://github.com/crazy-max/goreleaser-xx/tree/master/demo)
+of the repository.
diff --git a/www/docs/users.md b/www/docs/users.md
index 6cc1945a..9d21676e 100644
--- a/www/docs/users.md
+++ b/www/docs/users.md
@@ -29,12 +29,14 @@ Here's a running list of some organizations using GoReleaser[^1]:
 1. [Numary](https://numary.com)
 1. [Planetscale](https://planetscale.com)
 1. [Pulumi](https://pulumi.com)
+1. [prestd](https://prestd.com)
 1. [Schwarz IT](https://jobs.schwarz)
 1. [SemaphoreCI](https://semaphoreci.com)
 1. [Sigstore](https://sigstore.dev)
 1. [Splunk](http://dev.splunk.com)
 1. [Sysdig](https://sysdig.com)
 1. [TOTVS Labs](https://totvslabs.com)
+1. [Trybe](https://betrybe.com)
 
 Feel free to [add yours](https://github.com/goreleaser/goreleaser/edit/main/USERS.md)!
 
diff --git a/www/mkdocs.yml b/www/mkdocs.yml
index d406a6da..21ea3540 100644
--- a/www/mkdocs.yml
+++ b/www/mkdocs.yml
@@ -149,6 +149,7 @@ nav:
   - cookbooks/set-a-custom-git-tag.md
   - cookbooks/using-main.version.md
   - cookbooks/override-image-name.md
+  - cookbooks/goreleaser-xx.md
 - Community:
   - sponsors.md
   - users.md


Test patch:
diff --git a/internal/pipe/artifacts/artifacts_test.go b/internal/pipe/artifacts/artifacts_test.go
index e86d16da..c11a870d 100644
--- a/internal/pipe/artifacts/artifacts_test.go
+++ b/internal/pipe/artifacts/artifacts_test.go
@@ -1,6 +1,7 @@
 package artifacts
 
 import (
+	"os"
 	"path/filepath"
 	"testing"
 
@@ -30,5 +31,10 @@ func TestArtifacts(t *testing.T) {
 	})
 
 	require.NoError(t, Pipe{}.Run(ctx))
-	golden.RequireEqualJSON(t, golden.RequireReadFile(t, filepath.Join(tmp, "artifacts.json")))
+	path := filepath.Join(tmp, "artifacts.json")
+	golden.RequireEqualJSON(t, golden.RequireReadFile(t, path))
+
+	info, err := os.Stat(path)
+	require.NoError(t, err)
+	require.Equal(t, "-rw-r--r--", info.Mode().String())
 }
diff --git a/internal/testlib/git.go b/internal/testlib/git.go
index 775934f8..8ba174c5 100644
--- a/internal/testlib/git.go
+++ b/internal/testlib/git.go
@@ -79,6 +79,7 @@ func fakeGit(args ...string) (string, error) {
 		"-c", "user.name='GoReleaser'",
 		"-c", "user.email='test@goreleaser.github.com'",
 		"-c", "commit.gpgSign=false",
+		"-c", "tag.gpgSign=false",
 		"-c", "log.showSignature=false",
 	}
 	allArgs = append(allArgs, args...)