Repository: goreleaser/goreleaser
Pull request #2627 (2021-11-03 20:55:48)

refactor: improve release defaults
- renamed pipe to `scm release` to match our docs menu https://goreleaser.com/scm/github/
- avoid unneeded extra blocks
- fix bug that could happen when using gitea and gitlab + `ctx.Config.Release.Prerelease`

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2627?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2627](https://codecov.io/gh/goreleaser/goreleaser/pull/2627?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (8babd58) into [master](https://codecov.io/gh/goreleaser/goreleaser/commit/47d0e827436f3c2ed8caac9d7f508b2a862c0e00?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (47d0e82) will **decrease** coverage by `0.00%`.
> The diff coverage is `78.94%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2627/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/2627?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@            Coverage Diff             @@
##           master    #2627      +/-   ##
==========================================
- Coverage   84.64%   84.63%   -0.01%     
==========================================
  Files         100      100              
  Lines        7338     7336       -2     
==========================================
- Hits         6211     6209       -2     
  Misses        931      931              
  Partials      196      196              
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2627?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [internal/pipe/release/release.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2627/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9yZWxlYXNlL3JlbGVhc2UuZ28=) | `85.07% <78.94%> (-0.22%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2627?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/2627?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [47d0e82...8babd58](https://codecov.io/gh/goreleaser/goreleaser/pull/2627?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/.github/workflows/build.yml b/.github/workflows/build.yml
index 44ccf875..0e44a1d7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -61,7 +61,7 @@ jobs:
             ${{ runner.os }}-go-
       -
         name: Setup Sigstore
-        uses: sigstore/cosign-installer@v1.2.1
+        uses: sigstore/cosign-installer@v1.3.0
       -
         name: build and test
         run: task ci
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 99cf970a..566b0eae 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -210,6 +210,8 @@ publishers:
     cmd: ./scripts/fury-upload.sh {{ .ArtifactName }}
 
 release:
+  extra_files:
+    - glob: ./cosign.pub
   footer: |
     ## What to do next?
 
diff --git a/Dockerfile b/Dockerfile
index 59b22dc5..0644c440 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.17.2-alpine
+FROM golang:1.17.3-alpine
 
 RUN apk add --no-cache bash \
 	curl \
diff --git a/USERS.md b/USERS.md
index e33aa757..fe686960 100644
--- a/USERS.md
+++ b/USERS.md
@@ -7,6 +7,7 @@ Currently, the following organizations are using GoReleaser:
 
 1. [Charm](https://charm.sh)
 1. [Hugo](https://gohugo.io/)
+1. [IRON Security](https://iron.security)
 1. [Ministry of Justice (UK)](https://mojdigital.blog.gov.uk/)
 1. [Numary](https://numary.com)
 1. [Schwarz IT](https://jobs.schwarz/)
diff --git a/internal/linux/arch.go b/internal/linux/arch.go
index 2a26dcad..b3304aad 100644
--- a/internal/linux/arch.go
+++ b/internal/linux/arch.go
@@ -20,7 +20,7 @@ func Arch(key string) string {
 	case "arm6": // GOARCH + GOARM
 		return "armhf"
 	case "arm7": // GOARCH + GOARM
-		return "armv7l"
+		return "armhf"
 	case "mips64le":
 		return "mips64el"
 	case "mipsle":
diff --git a/internal/pipe/release/release.go b/internal/pipe/release/release.go
index d915c007..661cbec7 100644
--- a/internal/pipe/release/release.go
+++ b/internal/pipe/release/release.go
@@ -22,7 +22,7 @@ var ErrMultipleReleases = errors.New("multiple releases are defined. Only one is
 // Pipe for github release.
 type Pipe struct{}
 
-func (Pipe) String() string                 { return "github/gitlab/gitea releases" }
+func (Pipe) String() string                 { return "scm releases" }
 func (Pipe) Skip(ctx *context.Context) bool { return ctx.Config.Release.Disable }
 
 // Default sets the pipe defaults.
@@ -45,41 +45,32 @@ func (Pipe) Default(ctx *context.Context) error {
 		ctx.Config.Release.NameTemplate = "{{.Tag}}"
 	}
 
-	// nolint: exhaustive
 	switch ctx.TokenType {
 	case context.TokenTypeGitLab:
-		{
-			if ctx.Config.Release.GitLab.Name == "" {
-				repo, err := git.ExtractRepoFromConfig()
-				if err != nil {
-					return err
-				}
-				ctx.Config.Release.GitLab = repo
+		if ctx.Config.Release.GitLab.Name == "" {
+			repo, err := git.ExtractRepoFromConfig()
+			if err != nil {
+				return err
 			}
-
-			return nil
+			ctx.Config.Release.GitLab = repo
 		}
 	case context.TokenTypeGitea:
-		{
-			if ctx.Config.Release.Gitea.Name == "" {
-				repo, err := git.ExtractRepoFromConfig()
-				if err != nil {
-					return err
-				}
-				ctx.Config.Release.Gitea = repo
+		if ctx.Config.Release.Gitea.Name == "" {
+			repo, err := git.ExtractRepoFromConfig()
+			if err != nil {
+				return err
 			}
-
-			return nil
+			ctx.Config.Release.Gitea = repo
 		}
-	}
-
-	// We keep github as default for now
-	if ctx.Config.Release.GitHub.Name == "" {
-		repo, err := git.ExtractRepoFromConfig()
-		if err != nil && !ctx.Snapshot {
-			return err
+	default:
+		// We keep github as default for now
+		if ctx.Config.Release.GitHub.Name == "" {
+			repo, err := git.ExtractRepoFromConfig()
+			if err != nil && !ctx.Snapshot {
+				return err
+			}
+			ctx.Config.Release.GitHub = repo
 		}
-		ctx.Config.Release.GitHub = repo
 	}
 
 	// Check if we have to check the git tag for an indicator to mark as pre release
diff --git a/www/docs/ci/azurepipelines.md b/www/docs/ci/azurepipelines.md
index 26dff273..7f8e356f 100644
--- a/www/docs/ci/azurepipelines.md
+++ b/www/docs/ci/azurepipelines.md
@@ -1,6 +1,61 @@
 # Azure Pipelines
 
-Generally there're two ways to define an [Azure Pipeline](https://azure.microsoft.com/en-us/services/devops/pipelines/):
+GoReleaser can also be used within our official [GoReleaser Extensions for Azure DevOps][goreleaser-extension]
+through [Visual Studio marketplace][marketplace].
+
+### Task definition
+
+````yaml
+- task: goreleaser@0
+  inputs:
+    version: 'latest'
+    distribution: 'goreleaser'
+    args: ''
+    workdir: '$(Build.SourcesDirectory)'
+````
+
+### Task inputs
+
+Following inputs can be used
+
+| Name             | Type    | Default      | Description                                                      |
+|------------------|---------|--------------|------------------------------------------------------------------|
+| `distribution`   | String  | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` |
+| `version`**¹**   | String  | `latest`     | GoReleaser version                                               |
+| `args`           | String  |              | Arguments to pass to GoReleaser                                  |
+| `workdir`        | String  | `$(Build.SourcesDirectory)`          | Working directory (below repository root)                        |
+| `install-only`   | Bool    | `false`      | Just install GoReleaser                                          |
+
+> **¹** Can be a fixed version like `v0.132.0` or a max satisfying semver one like `~> 0.132`. In this case this will return `v0.132.1`.
+> For the `pro` version, add `-pro` to the string
+
+### Task environment variables
+
+```yaml
+...
+variables:
+- name: GORELEASER_KEY
+  value: xxx
+...
+
+or short:
+
+...
+variables:
+  GORELEASER_KEY: xxx
+...
+```
+
+Following environment variables can be used, as environment variable.
+
+| Name             | Description                           |
+|------------------|---------------------------------------|
+| `GITHUB_TOKEN`   | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) for e.g. `brew` or `gofish` |
+| `GORELEASER_KEY` | Your [GoReleaser Pro](https://goreleaser.com/pro) License Key, in case you are using the `goreleaser-pro` distribution                              |
+
+### Example pipeline
+
+Generally there are two ways to define an [Azure Pipeline](https://azure.microsoft.com/en-us/services/devops/pipelines/):
 Classic pipelines defined in the UI or YAML pipelines.
 
 Here is how to do it with YAML:
@@ -41,9 +96,16 @@ jobs:
           version: "$(GO_VERSION)"
         displayName: Install Go
 
-      - bash: curl -sL https://git.io/goreleaser | bash
-        displayName: Run Goreleaser
+      - task: goreleaser@0
+        inputs:
+          version: 'latest'
+          distribution: 'goreleaser'
+          args: ''
+          workdir: '$(Build.SourcesDirectory)'
 ```
 
-In this example a `Test` job is used to run `go test ./...` to first make sure that there're no failing tests.
-Only if that job succeeds and the pipeline was triggered from a tag (because of the defined `condition`) Goreleaser will be run.
+In this example a `Test` job is used to run `go test ./...` to first make sure that there're no failing tests. Only if
+that job succeeds and the pipeline was triggered from a tag (because of the defined `condition`) Goreleaser will be run.
+
+[goreleaser-extension]: https://marketplace.visualstudio.com/items?itemName=GoReleaser.goreleaser
+[marketplace]: https://marketplace.visualstudio.com/azuredevops
diff --git a/www/docs/users.md b/www/docs/users.md
index e33aa757..ca43189f 100644
--- a/www/docs/users.md
+++ b/www/docs/users.md
@@ -6,7 +6,9 @@ you are using GoReleaser.
 Currently, the following organizations are using GoReleaser:
 
 1. [Charm](https://charm.sh)
+1. [Compose Generator](https://www.compose-generator.com)
 1. [Hugo](https://gohugo.io/)
+1. [IRON Security](https://iron.security)
 1. [Ministry of Justice (UK)](https://mojdigital.blog.gov.uk/)
 1. [Numary](https://numary.com)
 1. [Schwarz IT](https://jobs.schwarz/)


Test patch:
diff --git a/internal/linux/arch_test.go b/internal/linux/arch_test.go
index 444599d8..591ca757 100644
--- a/internal/linux/arch_test.go
+++ b/internal/linux/arch_test.go
@@ -14,7 +14,7 @@ func TestArch(t *testing.T) {
 		"linuxarm64":             "arm64",
 		"linuxarm5":              "armel",
 		"linuxarm6":              "armhf",
-		"linuxarm7":              "armv7l",
+		"linuxarm7":              "armhf",
 		"linuxppc64":             "ppc64",
 		"linuxppc64le":           "ppc64le",
 		"linuxwhat":              "what",