Skip to content

Commit

Permalink
Generate goreleaser config if action is enabled and it is left unconf…
Browse files Browse the repository at this point in the history
…igured
  • Loading branch information
SuperSandro2000 committed Sep 4, 2024
1 parent 742cda2 commit 2feb4df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ goreleaser:
nameTemplate: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
```

If `goreleaser.createConfig` is set to true a config file for goreleaser will be generated based on the metadata of the repository.
If `goreleaser.createConfig` is set to true or it is unset but the release GitHub Workflow is enabled, a config file for goreleaser will be generated based on the metadata of the repository.
The `format` option can be used to only upload binaries. It corresponds to the upstream archives[].format option. See <https://goreleaser.com/customization/archive/> for more details.
The `binaryName` option can be used to change the name of the compiled binaries. It corresponds to the upstream builds[].binary option. This is only really useful when format is set to binary. It defaults to name of the first entry in the binaries option.
The `nameTemplate` option can be used to change the name of uploaded release artefacts. It corresponds to the upstream archives[].name_template option.
Expand Down
2 changes: 1 addition & 1 deletion internal/core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type GolangciLintConfiguration struct {
}

type GoReleaserConfiguration struct {
CreateConfig bool `yaml:"createConfig"`
CreateConfig *bool `yaml:"createConfig"`
BinaryName string `yaml:"binaryName"`
Files *[]string `yaml:"files"`
Format string `yaml:"format"`
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func main() {
}

// Render Goreleaser config file
if cfg.GoReleaser.CreateConfig {
if cfg.GoReleaser.CreateConfig == nil && cfg.GitHubWorkflow.Release.Enabled || *cfg.GoReleaser.CreateConfig {
goreleaser.RenderConfig(cfg)
}

Expand Down

0 comments on commit 2feb4df

Please sign in to comment.