From d45657a811984c56df4af3e7b774a5fbf09151e0 Mon Sep 17 00:00:00 2001 From: Honza Pecek Date: Wed, 11 Dec 2024 12:16:15 +0100 Subject: [PATCH 1/2] feat: stencilblock for goreleaser os+arch --- templates/.goreleaser.yml.tpl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/templates/.goreleaser.yml.tpl b/templates/.goreleaser.yml.tpl index b84b979e..4b83b394 100644 --- a/templates/.goreleaser.yml.tpl +++ b/templates/.goreleaser.yml.tpl @@ -16,11 +16,27 @@ builds: id: &name {{ $cmdName }} binary: *name goos: + {{- $goosBlockName := (printf "%vGoos" ($cmdName | replace "-" "" | replace "_" "")) }} + ## <> + {{- if not (empty (file.Block $goosBlockName)) }} + {{ (file.Block $goosBlockName) | trim }} + {{- else }} + ## Ability to build assets for those OS: linux, darwin - linux - darwin + {{- end }} + ## <> goarch: + {{- $goarchBlockName := (printf "%vGoarch" ($cmdName | replace "-" "" | replace "_" "")) }} + ## <> + {{- if not (empty (file.Block $goarchBlockName)) }} + {{ (file.Block $goarchBlockName) | trim }} + {{- else }} + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + {{- end }} + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ "{{" }} .Version {{ "}}" }}"' {{- if not $opts.delibird }} From 00b6fdcbcb1d94ec789d3749b36dffea7c86d69d Mon Sep 17 00:00:00 2001 From: Honza Pecek Date: Wed, 11 Dec 2024 12:19:38 +0100 Subject: [PATCH 2/2] fix: update snapshots --- ...oreleaser.yml.tpl-.goreleaser.yml.snapshot | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/templates/.snapshots/TestGoreleaserYml-.goreleaser.yml.tpl-.goreleaser.yml.snapshot b/templates/.snapshots/TestGoreleaserYml-.goreleaser.yml.tpl-.goreleaser.yml.snapshot index 7d83f111..9a168634 100644 --- a/templates/.snapshots/TestGoreleaserYml-.goreleaser.yml.tpl-.goreleaser.yml.snapshot +++ b/templates/.snapshots/TestGoreleaserYml-.goreleaser.yml.tpl-.goreleaser.yml.snapshot @@ -7,11 +7,17 @@ builds: id: &name cmd1 binary: *name goos: + ## <> + ## Ability to build assets for those OS: linux, darwin - linux - darwin + ## <> goarch: + ## <> + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"' - '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"' @@ -25,11 +31,17 @@ builds: id: &name cmd2 binary: *name goos: + ## <> + ## Ability to build assets for those OS: linux, darwin - linux - darwin + ## <> goarch: + ## <> + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"' - '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"' @@ -43,11 +55,17 @@ builds: id: &name cmd3-sub1 binary: *name goos: + ## <> + ## Ability to build assets for those OS: linux, darwin - linux - darwin + ## <> goarch: + ## <> + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"' - '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"' @@ -61,11 +79,17 @@ builds: id: &name cmd3-sub2 binary: *name goos: + ## <> + ## Ability to build assets for those OS: linux, darwin - linux - darwin + ## <> goarch: + ## <> + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"' - '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"' @@ -79,11 +103,17 @@ builds: id: &name cmd4_sub1 binary: *name goos: + ## <> + ## Ability to build assets for those OS: linux, darwin - linux - darwin + ## <> goarch: + ## <> + ## Ability to build assets for those architectures: amd64, arm64 - amd64 - arm64 + ## <> ldflags: - '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"' - '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'