Repository: goreleaser/goreleaser
Pull request #1162 (2019-10-01 18:33:30)

feat: support additional GOOS/GOARCH targets
Add support for additional targets:

GOOS=illumos GOARCH=amd64
GOOS=aix GOARCH=ppc64
GOOS=android GOARCH=386
GOOS=android GOARCH=amd64
GOOS=android GOARCH=arm64
GOOS=plan9 GOARCH=arm

maier: @caarlos0 I just noticed issue 1160, I can add the remaining new GOOS/GOARCH combos from go1.13 to this PR if you'd like. (sans jswasm which you have in another PR.)
caarlos0: that would be awesome. I did jswasm in another pr because it needed more things (`.wasm` ext), if that's not the case with the others, feel free to do it.

FWIW will merge that PR as well.

Thanks 🚀 
codecov-io: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1162?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@9d5f36f`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master    #1162   +/-   ##
=========================================
  Coverage          ?   82.98%           
=========================================
  Files             ?       58           
  Lines             ?     3262           
  Branches          ?        0           
=========================================
  Hits              ?     2707           
  Misses            ?      473           
  Partials          ?       82
```


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

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/1162?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/1162?src=pr&el=footer). Last update [9d5f36f...cba8d67](https://codecov.io/gh/goreleaser/goreleaser/pull/1162?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 b13baa19..703aef01 100644
--- a/internal/builders/golang/targets.go
+++ b/internal/builders/golang/targets.go
@@ -93,7 +93,11 @@ func valid(target target) bool {
 // list from https://golang.org/doc/install/source#environment
 // nolint: gochecknoglobals
 var validTargets = []string{
+	"aixppc64",
+	"android386",
+	"androidamd64",
 	"androidarm",
+	"androidarm64",
 	"darwin386",
 	"darwinamd64",
 	// "darwinarm", - requires admin rights and other ios stuff
@@ -102,6 +106,7 @@ var validTargets = []string{
 	"freebsd386",
 	"freebsdamd64",
 	"freebsdarm",
+	"illumosamd64",
 	"jswasm",
 	"linux386",
 	"linuxamd64",
@@ -122,6 +127,7 @@ var validTargets = []string{
 	"openbsdarm",
 	"plan9386",
 	"plan9amd64",
+	"plan9arm",
 	"solarisamd64",
 	"windows386",
 	"windowsamd64",


Test patch:
diff --git a/internal/builders/golang/targets_test.go b/internal/builders/golang/targets_test.go
index 1bbe7c64..c38557df 100644
--- a/internal/builders/golang/targets_test.go
+++ b/internal/builders/golang/targets_test.go
@@ -65,13 +65,18 @@ func TestGoosGoarchCombos(t *testing.T) {
 		valid bool
 	}{
 		// valid targets:
+		{"aix", "ppc64", true},
+		{"android", "386", true},
+		{"android", "amd64", true},
 		{"android", "arm", true},
+		{"android", "arm64", true},
 		{"darwin", "386", true},
 		{"darwin", "amd64", true},
 		{"dragonfly", "amd64", true},
 		{"freebsd", "386", true},
 		{"freebsd", "amd64", true},
 		{"freebsd", "arm", true},
+		{"illumos", "amd64", true},
 		{"linux", "386", true},
 		{"linux", "amd64", true},
 		{"linux", "arm", true},
@@ -91,6 +96,7 @@ func TestGoosGoarchCombos(t *testing.T) {
 		{"openbsd", "arm", true},
 		{"plan9", "386", true},
 		{"plan9", "amd64", true},
+		{"plan9", "arm", true},
 		{"solaris", "amd64", true},
 		{"windows", "386", true},
 		{"windows", "amd64", true},