1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-11-06 09:09:29 +02:00

feat: remove some deprecated code, go 1.15 support (#2985)

* feat: remove some deprecated code, go 1.15 support

- auto ignore darwin/arm64 on go <1.15, check https://goreleaser.com/deprecations/#builds-for-darwinarm64
- `dockers.use_buildx` (do not mix with `dockers.use: buildx`), check https://goreleaser.com/deprecations/#dockersuse_buildx

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* test: remove deprecated test
This commit is contained in:
Carlos Alexandro Becker
2022-03-16 23:37:29 -03:00
committed by GitHub
parent 077ce16174
commit d81820bb01
6 changed files with 10 additions and 59 deletions

View File

@@ -55,13 +55,6 @@ func matrix(build config.Build, version []byte) ([]string, error) {
if target.mips != "" && !contains(target.mips, validGomips) {
return result, fmt.Errorf("invalid gomips: %s", target.mips)
}
if target.os == "darwin" && target.arch == "arm64" && !go116re.Match(version) {
log.Warn(color.New(color.Bold, color.FgHiYellow).Sprintf(
"DEPRECATED: skipped darwin/arm64 build on Go < 1.16 for compatibility, check %s for more info.",
"https://goreleaser.com/deprecations/#builds-for-darwinarm64",
))
continue
}
if target.os == "windows" && target.arch == "arm64" && !go117re.Match(version) {
log.Warn(color.New(color.Bold, color.FgHiYellow).Sprintf(
"DEPRECATED: skipped windows/arm64 build on Go < 1.17 for compatibility, check %s for more info.",
@@ -138,10 +131,7 @@ func ignored(build config.Build, target target) bool {
return false
}
var (
go116re = regexp.MustCompile(`go version go1.1[6-9]`)
go117re = regexp.MustCompile(`go version go1.1[7-9]`)
)
var go117re = regexp.MustCompile(`go version go1.1[7-9]`)
func goVersion(build config.Build) ([]byte, error) {
cmd := exec.Command(build.GoBinary, "version")

View File

@@ -57,38 +57,6 @@ func TestAllBuildTargets(t *testing.T) {
},
}
t.Run("go 1.15", func(t *testing.T) {
result, err := matrix(build, []byte("go version go1.15.0"))
require.NoError(t, err)
require.Equal(t, []string{
"linux_386",
"linux_amd64",
"linux_arm_6",
"linux_arm64",
"linux_mips_hardfloat",
"linux_mips_softfloat",
"linux_mips64_softfloat",
"linux_mipsle_hardfloat",
"linux_mipsle_softfloat",
"linux_mips64le_hardfloat",
"linux_riscv64",
"darwin_amd64",
"freebsd_386",
"freebsd_amd64",
"freebsd_arm_6",
"freebsd_arm_7",
"freebsd_arm64",
"openbsd_386",
"openbsd_amd64",
"openbsd_arm64",
"windows_386",
"windows_amd64",
"windows_arm_6",
"windows_arm_7",
"js_wasm",
}, result)
})
t.Run("go 1.16", func(t *testing.T) {
result, err := matrix(build, []byte("go version go1.16.2"))
require.NoError(t, err)