Repository: goreleaser/goreleaser
Pull request #2144 (2021-03-28 14:40:19)

fix: build windows/arm
closes https://github.com/goreleaser/goreleaser/issues/2143

vercel[bot]: This pull request is being automatically deployed with Vercel ([learn more](https://vercel.link/github-learn-more)).  
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: [https://vercel.com/goreleaser/goreleaser/EgfYnW6AbxK6xyJ2LLiaRCQLBQ1w](https://vercel.com/goreleaser/goreleaser/EgfYnW6AbxK6xyJ2LLiaRCQLBQ1w)  
✅ Preview: *In Progress*


codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2144?src=pr&el=h1) Report
> Merging [#2144](https://codecov.io/gh/goreleaser/goreleaser/pull/2144?src=pr&el=desc) (9e05b5c) into [master](https://codecov.io/gh/goreleaser/goreleaser/commit/00bf7455340c3b6dcba7c02fef3839b0778ea18f?el=desc) (00bf745) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master    #2144   +/-   ##
=======================================
  Coverage   82.81%   82.81%           
=======================================
  Files          75       75           
  Lines        4039     4039           
=======================================
  Hits         3345     3345           
  Misses        566      566           
  Partials      128      128           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2144?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [internal/builders/golang/targets.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2144/diff?src=pr&el=tree#diff-aW50ZXJuYWwvYnVpbGRlcnMvZ29sYW5nL3RhcmdldHMuZ28=) | `90.76% <ø> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2144?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/2144?src=pr&el=footer). Last update [00bf745...9e05b5c](https://codecov.io/gh/goreleaser/goreleaser/pull/2144?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/internal/builders/golang/targets.go b/internal/builders/golang/targets.go
index f608137f..bb6e533a 100644
--- a/internal/builders/golang/targets.go
+++ b/internal/builders/golang/targets.go
@@ -178,6 +178,7 @@ var (
 		"plan9amd64",
 		"plan9arm",
 		"solarisamd64",
+		"windowsarm",
 		"windows386",
 		"windowsamd64",
 	}


Test patch:
diff --git a/internal/builders/golang/build_test.go b/internal/builders/golang/build_test.go
index fb8d3002..020b5835 100644
--- a/internal/builders/golang/build_test.go
+++ b/internal/builders/golang/build_test.go
@@ -54,6 +54,7 @@ func TestWithDefaults(t *testing.T) {
 				"linux_mips_softfloat",
 				"darwin_amd64",
 				"windows_amd64",
+				"windows_arm_6",
 				"linux_arm_6",
 			},
 			goBinary: "go1.2.3",
diff --git a/internal/builders/golang/targets_test.go b/internal/builders/golang/targets_test.go
index c8eb9085..b2af7e5e 100644
--- a/internal/builders/golang/targets_test.go
+++ b/internal/builders/golang/targets_test.go
@@ -16,6 +16,7 @@ func TestAllBuildTargets(t *testing.T) {
 			"darwin",
 			"freebsd",
 			"openbsd",
+			"windows",
 			"js",
 		},
 		Goarch: []string{
@@ -79,6 +80,10 @@ func TestAllBuildTargets(t *testing.T) {
 		"openbsd_386",
 		"openbsd_amd64",
 		"openbsd_arm64",
+		"windows_386",
+		"windows_amd64",
+		"windows_arm_6",
+		"windows_arm_7",
 		"js_wasm",
 	}, result)
 }
@@ -126,11 +131,11 @@ func TestGoosGoarchCombos(t *testing.T) {
 		{"solaris", "amd64", true},
 		{"windows", "386", true},
 		{"windows", "amd64", true},
+		{"windows", "arm", true},
 		{"js", "wasm", true},
 		// invalid targets
 		{"darwin", "386", false},
 		{"darwin", "arm", false},
-		{"windows", "arm", false},
 		{"windows", "arm64", false},
 		{"windows", "riscv64", false},
 	}