Repository: goreleaser/goreleaser
Pull request #1331 (2020-02-03 14:16:05)

wip: fix gomips
closes https://github.com/goreleaser/goreleaser/issues/1329

still need to add more tests

codecov-io: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=h1) Report
> Merging [#1331](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=desc) into [master](https://codecov.io/gh/goreleaser/goreleaser/commit/ca3a63a5373961c652c36b0b7bd286f781afbf65?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `83.33%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/graphs/tree.svg?width=650&token=3bJvv6b7hN&height=150&src=pr)](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #1331      +/-   ##
==========================================
+ Coverage   83.63%   83.65%   +0.01%     
==========================================
  Files          57       57              
  Lines        3282     3291       +9     
==========================================
+ Hits         2745     2753       +8     
- Misses        460      461       +1     
  Partials       77       77
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [internal/pipe/nfpm/nfpm.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcGlwZS9uZnBtL25mcG0uZ28=) | `92.53% <ø> (ø)` | :arrow_up: |
| [internal/tmpl/tmpl.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvdG1wbC90bXBsLmdv) | `100% <100%> (ø)` | :arrow_up: |
| [internal/pipe/archive/archive.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcGlwZS9hcmNoaXZlL2FyY2hpdmUuZ28=) | `96.25% <100%> (+0.04%)` | :arrow_up: |
| [internal/linux/arch.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvbGludXgvYXJjaC5nbw==) | `100% <100%> (ø)` | :arrow_up: |
| [internal/artifact/artifact.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvYXJ0aWZhY3QvYXJ0aWZhY3QuZ28=) | `83.62% <100%> (ø)` | :arrow_up: |
| [internal/pipe/snapcraft/snapcraft.go](https://codecov.io/gh/goreleaser/goreleaser/pull/1331/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcGlwZS9zbmFwY3JhZnQvc25hcGNyYWZ0Lmdv) | `81.09% <66.66%> (-0.04%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=footer). Last update [ca3a63a...823bb1d](https://codecov.io/gh/goreleaser/goreleaser/pull/1331?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/internal/artifact/artifact.go b/internal/artifact/artifact.go
index 58b631c6..e38c40d8 100644
--- a/internal/artifact/artifact.go
+++ b/internal/artifact/artifact.go
@@ -144,7 +144,7 @@ func (artifacts Artifacts) List() []*Artifact {
 func (artifacts Artifacts) GroupByPlatform() map[string][]*Artifact {
 	var result = map[string][]*Artifact{}
 	for _, a := range artifacts.items {
-		plat := a.Goos + a.Goarch + a.Goarm
+		plat := a.Goos + a.Goarch + a.Goarm + a.Gomips
 		result[plat] = append(result[plat], a)
 	}
 	return result
diff --git a/internal/linux/arch.go b/internal/linux/arch.go
index 62ce399e..748c112a 100644
--- a/internal/linux/arch.go
+++ b/internal/linux/arch.go
@@ -19,6 +19,7 @@ func Arch(key string) string {
 		return "armhf"
 	case "arm7": // GOARCH + GOARM
 		return "armhf"
+	default:
+		return arch
 	}
-	return arch
 }
diff --git a/internal/pipe/archive/archive.go b/internal/pipe/archive/archive.go
index 987c7024..4848c33d 100644
--- a/internal/pipe/archive/archive.go
+++ b/internal/pipe/archive/archive.go
@@ -25,8 +25,8 @@ import (
 )
 
 const (
-	defaultNameTemplate       = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
-	defaultBinaryNameTemplate = "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
+	defaultNameTemplate       = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
+	defaultBinaryNameTemplate = "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
 )
 
 // nolint: gochecknoglobals
@@ -162,6 +162,7 @@ func create(ctx *context.Context, archive config.Archive, binaries []*artifact.A
 		Goos:   binaries[0].Goos,
 		Goarch: binaries[0].Goarch,
 		Goarm:  binaries[0].Goarm,
+		Gomips: binaries[0].Gomips,
 		Extra: map[string]interface{}{
 			"Builds": binaries,
 			"ID":     archive.ID,
@@ -198,6 +199,7 @@ func skip(ctx *context.Context, archive config.Archive, binaries []*artifact.Art
 			Goos:   binary.Goos,
 			Goarch: binary.Goarch,
 			Goarm:  binary.Goarm,
+			Gomips: binary.Gomips,
 			Extra: map[string]interface{}{
 				"Builds": []*artifact.Artifact{binary},
 				"ID":     archive.ID,
diff --git a/internal/pipe/nfpm/nfpm.go b/internal/pipe/nfpm/nfpm.go
index 94e36da6..133aa747 100644
--- a/internal/pipe/nfpm/nfpm.go
+++ b/internal/pipe/nfpm/nfpm.go
@@ -24,7 +24,7 @@ import (
 	"github.com/goreleaser/goreleaser/pkg/context"
 )
 
-const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
+const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
 
 // Pipe for fpm packaging
 type Pipe struct{}
diff --git a/internal/pipe/scoop/scoop.go b/internal/pipe/scoop/scoop.go
index a512627e..51209a64 100644
--- a/internal/pipe/scoop/scoop.go
+++ b/internal/pipe/scoop/scoop.go
@@ -6,6 +6,7 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
+	"strings"
 
 	"github.com/goreleaser/goreleaser/internal/artifact"
 	"github.com/goreleaser/goreleaser/internal/client"
@@ -85,6 +86,14 @@ func doRun(ctx *context.Context, client client.Client) error {
 
 	if ctx.SkipPublish {
 		return pipe.ErrSkipPublishEnabled
+
+	}
+	if strings.TrimSpace(ctx.Config.Scoop.SkipUpload) == "true" {
+		return pipe.Skip("scoop.skip_upload is true")
+	} else if strings.TrimSpace(ctx.Config.Scoop.SkipUpload) == "auto" {
+		if ctx.Semver.Prerelease != "" {
+			return pipe.Skip("release is prerelease")
+		}
 	}
 	if ctx.Config.Release.Draft {
 		return pipe.Skip("release is marked as draft")
diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go
index e033a5b6..93ac5a4d 100644
--- a/internal/pipe/snapcraft/snapcraft.go
+++ b/internal/pipe/snapcraft/snapcraft.go
@@ -55,7 +55,7 @@ type AppMetadata struct {
 	Completer string   `yaml:",omitempty"`
 }
 
-const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
+const defaultNameTemplate = "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
 
 // Pipe for snapcraft packaging
 type Pipe struct{}
@@ -117,7 +117,7 @@ func doRun(ctx *context.Context, snap config.Snapcraft) error {
 		),
 	).GroupByPlatform() {
 		arch := linux.Arch(platform)
-		if arch == "armel" {
+		if !isValidArch(arch) {
 			log.WithField("arch", arch).Warn("ignored unsupported arch")
 			continue
 		}
@@ -129,6 +129,16 @@ func doRun(ctx *context.Context, snap config.Snapcraft) error {
 	return g.Wait()
 }
 
+func isValidArch(arch string) bool {
+	// https://snapcraft.io/docs/architectures
+	for _, a := range []string{"s390x", "ppc64el", "arm64", "armhf", "amd64", "i386"} {
+		if arch == a {
+			return true
+		}
+	}
+	return false
+}
+
 // Publish packages
 func (Pipe) Publish(ctx *context.Context) error {
 	snaps := ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableSnapcraft)).List()
diff --git a/internal/tmpl/tmpl.go b/internal/tmpl/tmpl.go
index c5f1a36c..fe995d59 100644
--- a/internal/tmpl/tmpl.go
+++ b/internal/tmpl/tmpl.go
@@ -38,6 +38,7 @@ const (
 	os           = "Os"
 	arch         = "Arch"
 	arm          = "Arm"
+	mips         = "Mips"
 	binary       = "Binary"
 	artifactName = "ArtifactName"
 	// gitlab only
@@ -92,6 +93,7 @@ func (t *Template) WithArtifact(a *artifact.Artifact, replacements map[string]st
 	t.fields[os] = replace(replacements, a.Goos)
 	t.fields[arch] = replace(replacements, a.Goarch)
 	t.fields[arm] = replace(replacements, a.Goarm)
+	t.fields[mips] = replace(replacements, a.Gomips)
 	t.fields[binary] = bin.(string)
 	t.fields[artifactName] = a.Name
 	if val, ok := a.Extra["ArtifactUploadHash"]; ok {
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 658d8f2e..e714c5ff 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -81,6 +81,7 @@ type Scoop struct {
 	License      string       `yaml:",omitempty"`
 	URLTemplate  string       `yaml:"url_template,omitempty"`
 	Persist      []string     `yaml:"persist,omitempty"`
+	SkipUpload   string       `yaml:"skip_upload,omitempty"`
 }
 
 // CommitAuthor is the author of a Git commit
diff --git a/www/content/archive.md b/www/content/archive.md
index c1ebf28b..416357a9 100644
--- a/www/content/archive.md
+++ b/www/content/archive.md
@@ -26,9 +26,9 @@ archives:
     # Archive name template.
     # Defaults:
     # - if format is `tar.gz`, `gz` or `zip`:
-    #   - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
+    #   - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
     # - if format is `binary`:
-    #   - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
+    #   - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
     name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
 
     # Replacements for GOOS and GOARCH in the archive name.
diff --git a/www/content/nfpm.md b/www/content/nfpm.md
index 3544d8d4..f51feda5 100644
--- a/www/content/nfpm.md
+++ b/www/content/nfpm.md
@@ -24,7 +24,7 @@ nfpms:
     package_name: foo
 
     # You can change the file name of the package.
-    # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
+    # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
     file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
 
     # Build IDs for the builds you want to create NFPM packages for.
diff --git a/www/content/snapcraft.md b/www/content/snapcraft.md
index 0d1ac956..b3f46c40 100644
--- a/www/content/snapcraft.md
+++ b/www/content/snapcraft.md
@@ -31,7 +31,7 @@ snapcrafts:
     - bar
 
     # You can change the name of the package.
-    # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
+    # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
     name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
 
     # Replacements for GOOS and GOARCH in the package name.
diff --git a/www/content/templates.md b/www/content/templates.md
index b1910b31..ee519d82 100644
--- a/www/content/templates.md
+++ b/www/content/templates.md
@@ -37,6 +37,7 @@ may have some extra fields:
 |      `.Os`      |  `GOOS` (usually allow replacements)  |
 |     `.Arch`     | `GOARCH` (usually allow replacements) |
 |     `.Arm`      | `GOARM` (usually allow replacements)  |
+|     `.Mips`     | `GOMIPS` (usually allow replacements) |
 |    `.Binary`    |              Binary name              |
 | `.ArtifactName` |             Archive name              |
 


Test patch:
diff --git a/internal/artifact/artifact_test.go b/internal/artifact/artifact_test.go
index cd364c39..0380eac3 100644
--- a/internal/artifact/artifact_test.go
+++ b/internal/artifact/artifact_test.go
@@ -124,6 +124,18 @@ func TestGroupByPlatform(t *testing.T) {
 			Goarch: "arm",
 			Goarm:  "6",
 		},
+		{
+			Name:   "foobar",
+			Goos:   "linux",
+			Goarch: "mips",
+			Goarm:  "softfloat",
+		},
+		{
+			Name:   "foobar",
+			Goos:   "linux",
+			Goarch: "mips",
+			Goarm:  "hardfloat",
+		},
 		{
 			Name: "check",
 			Type: Checksum,
@@ -137,6 +149,8 @@ func TestGroupByPlatform(t *testing.T) {
 	var groups = artifacts.GroupByPlatform()
 	assert.Len(t, groups["linuxamd64"], 2)
 	assert.Len(t, groups["linuxarm6"], 1)
+	assert.Len(t, groups["linuxmipssoftfloat"], 1)
+	assert.Len(t, groups["linuxmipshardfloat"], 1)
 }
 
 func TestChecksum(t *testing.T) {
diff --git a/internal/pipe/archive/archive_test.go b/internal/pipe/archive/archive_test.go
index 47a4533a..162a0cc1 100644
--- a/internal/pipe/archive/archive_test.go
+++ b/internal/pipe/archive/archive_test.go
@@ -22,6 +22,12 @@ func TestDescription(t *testing.T) {
 	require.NotEmpty(t, Pipe{}.String())
 }
 
+func createFakeBinary(t *testing.T, dist, arch, bin string) {
+	require.NoError(t, os.Mkdir(filepath.Join(dist, arch), 0755))
+	_, err := os.Create(filepath.Join(dist, arch, bin))
+	require.NoError(t, err)
+}
+
 func TestRunPipe(t *testing.T) {
 	folder, back := testlib.Mktmp(t)
 	defer back()
@@ -29,13 +35,11 @@ func TestRunPipe(t *testing.T) {
 		t.Run("Archive format "+format, func(tt *testing.T) {
 			var dist = filepath.Join(folder, format+"_dist")
 			require.NoError(t, os.Mkdir(dist, 0755))
-			require.NoError(t, os.Mkdir(filepath.Join(dist, "darwinamd64"), 0755))
-			require.NoError(t, os.Mkdir(filepath.Join(dist, "windowsamd64"), 0755))
-			_, err := os.Create(filepath.Join(dist, "darwinamd64", "mybin"))
-			require.NoError(t, err)
-			_, err = os.Create(filepath.Join(dist, "windowsamd64", "mybin.exe"))
-			require.NoError(t, err)
-			_, err = os.Create(filepath.Join(folder, "README.md"))
+			for _, arch := range []string{"darwinamd64", "linux386", "linuxarm7", "linuxmipssoftfloat"} {
+				createFakeBinary(t, dist, arch, "mybin")
+			}
+			createFakeBinary(t, dist, "windowsamd64", "mybin.exe")
+			_, err := os.Create(filepath.Join(folder, "README.md"))
 			require.NoError(t, err)
 			require.NoError(t, os.MkdirAll(filepath.Join(folder, "foo", "bar", "foobar"), 0755))
 			_, err = os.Create(filepath.Join(filepath.Join(folder, "foo", "bar", "foobar", "blah.txt")))
@@ -46,7 +50,7 @@ func TestRunPipe(t *testing.T) {
 					ProjectName: "foobar",
 					Archives: []config.Archive{
 						{
-							ID:           "defaultarch",
+							ID:           "myid",
 							Builds:       []string{"default"},
 							NameTemplate: defaultNameTemplate,
 							Files: []string{
@@ -74,6 +78,41 @@ func TestRunPipe(t *testing.T) {
 					"ID":     "default",
 				},
 			}
+			var linux386Build = &artifact.Artifact{
+				Goos:   "linux",
+				Goarch: "386",
+				Name:   "mybin",
+				Path:   filepath.Join(dist, "linux386", "mybin"),
+				Type:   artifact.Binary,
+				Extra: map[string]interface{}{
+					"Binary": "mybin",
+					"ID":     "default",
+				},
+			}
+			var linuxArmBuild = &artifact.Artifact{
+				Goos:   "linux",
+				Goarch: "arm",
+				Goarm:  "7",
+				Name:   "mybin",
+				Path:   filepath.Join(dist, "linuxarm7", "mybin"),
+				Type:   artifact.Binary,
+				Extra: map[string]interface{}{
+					"Binary": "mybin",
+					"ID":     "default",
+				},
+			}
+			var linuxMipsBuild = &artifact.Artifact{
+				Goos:   "linux",
+				Goarch: "mips",
+				Gomips: "softfloat",
+				Name:   "mybin",
+				Path:   filepath.Join(dist, "linuxmipssoftfloat", "mybin"),
+				Type:   artifact.Binary,
+				Extra: map[string]interface{}{
+					"Binary": "mybin",
+					"ID":     "default",
+				},
+			}
 			var windowsBuild = &artifact.Artifact{
 				Goos:   "windows",
 				Goarch: "amd64",
@@ -87,37 +126,41 @@ func TestRunPipe(t *testing.T) {
 				},
 			}
 			ctx.Artifacts.Add(darwinBuild)
+			ctx.Artifacts.Add(linux386Build)
+			ctx.Artifacts.Add(linuxArmBuild)
+			ctx.Artifacts.Add(linuxMipsBuild)
 			ctx.Artifacts.Add(windowsBuild)
 			ctx.Version = "0.0.1"
 			ctx.Git.CurrentTag = "v0.0.1"
 			ctx.Config.Archives[0].Format = format
 			require.NoError(tt, Pipe{}.Run(ctx))
-			var archives = ctx.Artifacts.Filter(artifact.ByType(artifact.UploadableArchive))
-			for _, arch := range archives.List() {
-				require.Equal(t, "defaultarch", arch.Extra["ID"].(string), "all archives should have the archive ID set")
+			var archives = ctx.Artifacts.Filter(artifact.ByType(artifact.UploadableArchive)).List()
+			for _, arch := range archives {
+				require.Equal(t, "myid", arch.Extra["ID"].(string), "all archives should have the archive ID set")
 			}
-			require.Len(tt, archives.List(), 2)
-			darwin := archives.Filter(artifact.ByGoos("darwin")).List()[0]
-			windows := archives.Filter(artifact.ByGoos("windows")).List()[0]
-			require.Equal(tt, "foobar_0.0.1_darwin_amd64."+format, darwin.Name)
-			require.Equal(tt, "foobar_0.0.1_windows_amd64.zip", windows.Name)
-
-			require.Equal(t, []*artifact.Artifact{darwinBuild}, darwin.Extra["Builds"].([]*artifact.Artifact))
-			require.Equal(t, []*artifact.Artifact{windowsBuild}, windows.Extra["Builds"].([]*artifact.Artifact))
+			require.Len(t, archives, 5)
+			// TODO: should verify the artifact fields here too
 
 			if format == "tar.gz" {
 				// Check archive contents
-				require.Equal(
-					t,
-					[]string{
-						"README.md",
-						"foo/bar",
-						"foo/bar/foobar",
-						"foo/bar/foobar/blah.txt",
-						"mybin",
-					},
-					tarFiles(t, filepath.Join(dist, "foobar_0.0.1_darwin_amd64.tar.gz")),
-				)
+				for _, name := range []string{
+					"foobar_0.0.1_darwin_amd64.tar.gz",
+					"foobar_0.0.1_linux_386.tar.gz",
+					"foobar_0.0.1_linux_armv7.tar.gz",
+					"foobar_0.0.1_linux_mips_softfloat.tar.gz",
+				} {
+					require.Equal(
+						t,
+						[]string{
+							"README.md",
+							"foo/bar",
+							"foo/bar/foobar",
+							"foo/bar/foobar/blah.txt",
+							"mybin",
+						},
+						tarFiles(t, filepath.Join(dist, name)),
+					)
+				}
 			}
 			if format == "zip" {
 				require.Equal(
diff --git a/internal/pipe/scoop/scoop_test.go b/internal/pipe/scoop/scoop_test.go
index f6b31f6f..e6e93f9b 100644
--- a/internal/pipe/scoop/scoop_test.go
+++ b/internal/pipe/scoop/scoop_test.go
@@ -495,6 +495,100 @@ func Test_doRun(t *testing.T) {
 			},
 			shouldErr("release is marked as draft"),
 		},
+		{
+			"is prerelease and skip upload set to auto",
+			args{
+				&context.Context{
+					TokenType: context.TokenTypeGitHub,
+					Git: context.GitInfo{
+						CurrentTag: "v1.0.1-pre.1",
+					},
+					Semver: context.Semver{
+						Major:      1,
+						Minor:      0,
+						Patch:      1,
+						Prerelease: "-pre.1",
+					},
+					Version:   "1.0.1-pre.1",
+					Artifacts: artifact.New(),
+					Config: config.Project{
+						Builds: []config.Build{
+							{Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}},
+						},
+						Dist:        ".",
+						ProjectName: "run-pipe",
+						Archives: []config.Archive{
+							{Format: "tar.gz"},
+						},
+						Release: config.Release{
+							GitHub: config.Repo{
+								Owner: "test",
+								Name:  "test",
+							},
+						},
+						Scoop: config.Scoop{
+							SkipUpload: "auto",
+							Bucket: config.Repo{
+								Owner: "test",
+								Name:  "test",
+							},
+							Description: "A run pipe test formula",
+							Homepage:    "https://github.com/goreleaser",
+						},
+					},
+				},
+				&DummyClient{},
+			},
+			[]*artifact.Artifact{
+				{Name: "foo_1.0.1-pre.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64", Path: file},
+				{Name: "foo_1.0.1-pre.1_windows_386.tar.gz", Goos: "windows", Goarch: "386", Path: file},
+			},
+			shouldErr("release is prerelease"),
+		},
+		{
+			"skip upload set to true",
+			args{
+				&context.Context{
+					TokenType: context.TokenTypeGitHub,
+					Git: context.GitInfo{
+						CurrentTag: "v1.0.1",
+					},
+					Version:   "1.0.1",
+					Artifacts: artifact.New(),
+					Config: config.Project{
+						Builds: []config.Build{
+							{Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}},
+						},
+						Dist:        ".",
+						ProjectName: "run-pipe",
+						Archives: []config.Archive{
+							{Format: "tar.gz"},
+						},
+						Release: config.Release{
+							GitHub: config.Repo{
+								Owner: "test",
+								Name:  "test",
+							},
+						},
+						Scoop: config.Scoop{
+							SkipUpload: "true",
+							Bucket: config.Repo{
+								Owner: "test",
+								Name:  "test",
+							},
+							Description: "A run pipe test formula",
+							Homepage:    "https://github.com/goreleaser",
+						},
+					},
+				},
+				&DummyClient{},
+			},
+			[]*artifact.Artifact{
+				{Name: "foo_1.0.1-pre.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64", Path: file},
+				{Name: "foo_1.0.1-pre.1_windows_386.tar.gz", Goos: "windows", Goarch: "386", Path: file},
+			},
+			shouldErr("scoop.skip_upload is true"),
+		},
 		{
 			"release is disabled",
 			args{
diff --git a/internal/pipe/snapcraft/snapcraft_test.go b/internal/pipe/snapcraft/snapcraft_test.go
index ec84b4e9..9263dd73 100644
--- a/internal/pipe/snapcraft/snapcraft_test.go
+++ b/internal/pipe/snapcraft/snapcraft_test.go
@@ -13,7 +13,7 @@ import (
 	"github.com/goreleaser/goreleaser/pkg/context"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
-	yaml "gopkg.in/yaml.v2"
+	"gopkg.in/yaml.v2"
 )
 
 func TestDescription(t *testing.T) {
@@ -397,3 +397,24 @@ func TestSeveralSnapssWithTheSameID(t *testing.T) {
 	}
 	require.EqualError(t, Pipe{}.Default(ctx), "found 2 snapcrafts with the ID 'a', please fix your config")
 }
+
+func Test_isValidArch(t *testing.T) {
+	tests := []struct {
+		arch string
+		want bool
+	}{
+		{"s390x", true},
+		{"ppc64el", true},
+		{"arm64", true},
+		{"armhf", true},
+		{"amd64", true},
+		{"i386", true},
+		{"mips", false},
+		{"armel", false},
+	}
+	for _, tt := range tests {
+		t.Run(tt.arch, func(t *testing.T) {
+			require.Equal(t, tt.want, isValidArch(tt.arch))
+		})
+	}
+}
diff --git a/internal/tmpl/tmpl_test.go b/internal/tmpl/tmpl_test.go
index 7e72672b..01472887 100644
--- a/internal/tmpl/tmpl_test.go
+++ b/internal/tmpl/tmpl_test.go
@@ -31,6 +31,7 @@ func TestWithArtifact(t *testing.T) {
 		"Linux":       "{{.Os}}",
 		"amd64":       "{{.Arch}}",
 		"6":           "{{.Arm}}",
+		"softfloat":   "{{.Mips}}",
 		"1.2.3":       "{{.Version}}",
 		"v1.2.3":      "{{.Tag}}",
 		"1-2-3":       "{{.Major}}-{{.Minor}}-{{.Patch}}",
@@ -51,6 +52,7 @@ func TestWithArtifact(t *testing.T) {
 					Goarch: "amd64",
 					Goos:   "linux",
 					Goarm:  "6",
+					Gomips: "softfloat",
 					Extra: map[string]interface{}{
 						"Binary": "binary",
 					},