Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: stencil blocks around arch+os in .goreleaser.yml #561

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions templates/.goreleaser.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,27 @@ builds:
id: &name {{ $cmdName }}
binary: *name
goos:
{{- $goosBlockName := (printf "%vGoos" ($cmdName | replace "-" "" | replace "_" "")) }}
## <<Stencil::Block({{ $goosBlockName }})>>
{{- if not (empty (file.Block $goosBlockName)) }}
{{ (file.Block $goosBlockName) | trim }}
{{- else }}
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
{{- end }}
## <</Stencil::Block>>
goarch:
{{- $goarchBlockName := (printf "%vGoarch" ($cmdName | replace "-" "" | replace "_" "")) }}
## <<Stencil::Block({{ $goarchBlockName }})>>
{{- if not (empty (file.Block $goarchBlockName)) }}
{{ (file.Block $goarchBlockName) | trim }}
{{- else }}
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
{{- end }}
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ "{{" }} .Version {{ "}}" }}"'
{{- if not $opts.delibird }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ builds:
id: &name cmd1
binary: *name
goos:
## <<Stencil::Block(cmd1Goos)>>
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
## <</Stencil::Block>>
goarch:
## <<Stencil::Block(cmd1Goarch)>>
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
Expand All @@ -25,11 +31,17 @@ builds:
id: &name cmd2
binary: *name
goos:
## <<Stencil::Block(cmd2Goos)>>
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
## <</Stencil::Block>>
goarch:
## <<Stencil::Block(cmd2Goarch)>>
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
Expand All @@ -43,11 +55,17 @@ builds:
id: &name cmd3-sub1
binary: *name
goos:
## <<Stencil::Block(cmd3sub1Goos)>>
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
## <</Stencil::Block>>
goarch:
## <<Stencil::Block(cmd3sub1Goarch)>>
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
Expand All @@ -61,11 +79,17 @@ builds:
id: &name cmd3-sub2
binary: *name
goos:
## <<Stencil::Block(cmd3sub2Goos)>>
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
## <</Stencil::Block>>
goarch:
## <<Stencil::Block(cmd3sub2Goarch)>>
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
Expand All @@ -79,11 +103,17 @@ builds:
id: &name cmd4_sub1
binary: *name
goos:
## <<Stencil::Block(cmd4sub1Goos)>>
## Ability to build assets for those OS: linux, darwin
- linux
- darwin
## <</Stencil::Block>>
goarch:
## <<Stencil::Block(cmd4sub1Goarch)>>
## Ability to build assets for those architectures: amd64, arm64
- amd64
- arm64
## <</Stencil::Block>>
ldflags:
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
Expand Down