From d3ce82ff9f75a74320d7ed9a353f002c6ebb9f08 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 14 Oct 2024 11:29:05 -0300 Subject: [PATCH] fix: tmpl `.386` -> `.I386` Template key can't start with a number. Refs #5186 --- internal/tmpl/tmpl.go | 2 +- internal/tmpl/tmpl_test.go | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/internal/tmpl/tmpl.go b/internal/tmpl/tmpl.go index bfbb8743d..7493d8a42 100644 --- a/internal/tmpl/tmpl.go +++ b/internal/tmpl/tmpl.go @@ -68,7 +68,7 @@ const ( osKey = "Os" arch = "Arch" amd64 = "Amd64" - go386 = "386" + go386 = "I386" arm = "Arm" arm64 = "Arm64" mips = "Mips" diff --git a/internal/tmpl/tmpl_test.go b/internal/tmpl/tmpl_test.go index 9e8395fe2..c26fa590f 100644 --- a/internal/tmpl/tmpl_test.go +++ b/internal/tmpl/tmpl_test.go @@ -58,6 +58,10 @@ func TestWithArtifact(t *testing.T) { "6": "{{.Arm}}", "softfloat": "{{.Mips}}", "v3": "{{.Amd64}}", + "sse2": "{{.I386}}", + "power8": "{{.Ppc64}}", + "rva22u64": "{{.Riscv64}}", + "v8.0": "{{.Arm64}}", "1.2.3": "{{.Version}}", "v1.2.3": "{{.Tag}}", "1-2-3": "{{.Major}}-{{.Minor}}-{{.Patch}}", @@ -110,13 +114,17 @@ func TestWithArtifact(t *testing.T) { t.Parallel() result, err := New(ctx).WithArtifact( &artifact.Artifact{ - Name: "not-this-binary", - Path: "/tmp/foo.exe", - Goarch: "amd64", - Goos: "linux", - Goarm: "6", - Gomips: "softfloat", - Goamd64: "v3", + Name: "not-this-binary", + Path: "/tmp/foo.exe", + Goarch: "amd64", + Goos: "linux", + Goarm: "6", + Gomips: "softfloat", + Goamd64: "v3", + Goarm64: "v8.0", + Go386: "sse2", + Goppc64: "power8", + Goriscv64: "rva22u64", Extra: map[string]interface{}{ artifact.ExtraBinary: "binary", artifact.ExtraExt: ".exe",