mirror of
https://github.com/therootcompany/golib.git
synced 2026-03-02 23:57:59 +00:00
feat(monorel): match goreleaser comment style in generated .goreleaser.yaml
- Replace "Generated by monorel" header with goreleaser-style preamble
("This file is generated by monorel ... check the docs at goreleaser.com")
- Add modeline explainer comment block before the yaml-language-server line
- Add "you may remove this if you don't need go generate" comment inline
- Combine name_template comments into goreleaser-style single comment
("this name template makes the OS and Arch compatible with uname")
This commit is contained in:
parent
98bdc47746
commit
f3eff585c4
@ -1188,11 +1188,16 @@ func goreleaserYAML(projectName string, bins []binary) string {
|
||||
w := func(s string) { b.WriteString(s) }
|
||||
wf := func(format string, args ...any) { fmt.Fprintf(&b, format, args...) }
|
||||
|
||||
w("# This file is generated by monorel (github.com/therootcompany/golib/tools/monorel).\n")
|
||||
w("# Make sure to check the documentation at https://goreleaser.com\n")
|
||||
w("\n# The lines below are called `modelines`. See `:help modeline`\n")
|
||||
w("# Feel free to remove those if you don't want/need to use them.\n")
|
||||
w("# yaml-language-server: $schema=https://goreleaser.com/static/schema.json\n")
|
||||
w("# vim: set ts=2 sw=2 tw=0 fo=cnqoj\n")
|
||||
w("# Generated by monorel (github.com/therootcompany/golib/tools/monorel)\n")
|
||||
w("\nversion: 2\n")
|
||||
w("\nbefore:\n hooks:\n - go mod tidy\n - go generate ./...\n")
|
||||
w("\nbefore:\n hooks:\n - go mod tidy\n")
|
||||
w(" # you may remove this if you don't need go generate\n")
|
||||
w(" - go generate ./...\n")
|
||||
|
||||
w("\nbuilds:\n")
|
||||
for _, bin := range bins {
|
||||
@ -1216,8 +1221,8 @@ func goreleaserYAML(projectName string, bins []binary) string {
|
||||
wf(" - id: %s\n", bin.name)
|
||||
wf(" ids: [%s]\n", bin.name)
|
||||
w(" formats: [tar.gz, tar.zst]\n")
|
||||
w(" # name_template uses VERSION env var so the prefixed monorepo tag\n")
|
||||
w(" # doesn't appear in archive filenames.\n")
|
||||
w(" # this name template makes the OS and Arch compatible with the results of `uname`.\n")
|
||||
w(" # it uses the VERSION env var so the prefixed monorepo tag doesn't appear in archive filenames.\n")
|
||||
w(" name_template: >-\n")
|
||||
wf(" %s_{{ .Env.VERSION }}_\n", bin.name)
|
||||
w(" {{- title .Os }}_\n")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user