1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-05 13:15:26 +02:00

Merge remote-tracking branch 'origin/master' into archive

This commit is contained in:
Carlos Alexandro Becker 2017-06-22 11:04:21 -03:00
commit 21571bef84
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
14 changed files with 33 additions and 28 deletions

2
Gopkg.lock generated
View File

@ -100,6 +100,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "15a60b1efa147cc2507589fd45e4b767e118c6853c6ae2e2728a6ba01b818fe4"
inputs-digest = "d6da23d2c5d62fbc0e9d6effeeea88169d4c5add4eb620087f17af4853a41cc4"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -45,7 +45,7 @@ func (ctx *Context) AddArtifact(file string) {
file = strings.TrimPrefix(file, ctx.Config.Dist)
file = strings.Replace(file, "/", "", -1)
ctx.Artifacts = append(ctx.Artifacts, file)
log.WithField("artifact", file).Info("Registered")
log.WithField("artifact", file).Info("registered")
}
// New context

View File

@ -56,7 +56,7 @@ func Release(flags Flags) error {
if !os.IsNotExist(statErr) || flags.IsSet("config") {
return err
}
log.WithField("file", file).Warn("Could not load")
log.WithField("file", file).Warn("could not load config")
}
var ctx = context.New(cfg)
ctx.Validate = !flags.Bool("skip-validate")
@ -66,12 +66,12 @@ func Release(flags Flags) error {
if err != nil {
return err
}
log.WithField("notes", notes).Info("Loaded custom release notes")
log.WithField("notes", notes).Info("loaded custom release notes")
ctx.ReleaseNotes = string(bts)
}
ctx.Snapshot = flags.Bool("snapshot")
if ctx.Snapshot {
log.Info("Publishing disabled in snapshot mode")
log.Info("publishing disabled in snapshot mode")
ctx.Publish = false
}
for _, pipe := range pipes {

View File

@ -98,7 +98,7 @@ func (c *githubClient) CreateRelease(ctx *context.Context, body string) (release
data,
)
}
log.Infof("Release updated: %v\n", release.GetHTMLURL())
log.WithField("url", release.GetHTMLURL()).Info("release updated")
return release.GetID(), err
}

View File

@ -53,7 +53,7 @@ func main() {
},
}
app.Action = func(c *cli.Context) error {
log.Infof("Running goreleaser %v", version)
log.Infof("running goreleaser %v", version)
if err := goreleaserlib.Release(c); err != nil {
return cli.NewExitError(err.Error(), 1)
}
@ -70,12 +70,13 @@ func main() {
return cli.NewExitError(err.Error(), 1)
}
log.Infof("%s created. Please edit accordingly to your needs.", filename)
log.WithField("file", filename).
Info("config create, please edit accordingly to your needs")
return nil
},
},
}
if err := app.Run(os.Args); err != nil {
log.WithError(err).Fatal("Failed")
log.WithError(err).Fatal("failed")
}
}

View File

@ -44,7 +44,7 @@ func create(ctx *context.Context, platform, name string) error {
if err != nil {
return err
}
log.WithField("archive", file.Name()).Info("Creating")
log.WithField("archive", file.Name()).Info("creating")
defer func() { _ = file.Close() }()
var archive = archive.New(file)
defer func() { _ = archive.Close() }()

View File

@ -95,19 +95,21 @@ func (Pipe) Run(ctx *context.Context) error {
func doRun(ctx *context.Context, client client.Client) error {
if !ctx.Publish {
log.Warn("Skipped because --skip-publish is set")
log.Warn("skipped because --skip-publish is set")
return nil
}
if ctx.Config.Brew.GitHub.Name == "" {
log.Warn("Skipped because brew section is not configured")
log.Warn("skipped because brew section is not configured")
return nil
}
if ctx.Config.Release.Draft {
log.Warn("Skipped because release is marked as draft")
log.Warn("skipped because release is marked as draft")
return nil
}
path := filepath.Join(ctx.Config.Brew.Folder, ctx.Config.Build.Binary+".rb")
log.WithField("formula", path).WithField("repo", ctx.Config.Brew.GitHub.String()).Info("Pushing")
log.WithField("formula", path).
WithField("repo", ctx.Config.Brew.GitHub.String()).
Info("pushing")
content, err := buildFormula(ctx, client)
if err != nil {
return err

View File

@ -56,7 +56,7 @@ func runHook(env []string, hook string) error {
if hook == "" {
return nil
}
log.WithField("hook", hook).Info("Running hook")
log.WithField("hook", hook).Info("running hook")
cmd := strings.Fields(hook)
return run(runtimeTarget, cmd, env)
}
@ -67,7 +67,7 @@ func build(ctx *context.Context, name string, target buildTarget) error {
name,
ctx.Config.Build.Binary+ext.For(target.goos),
)
log.WithField("binary", output).Info("Building")
log.WithField("binary", output).Info("building")
cmd := []string{"go", "build"}
if ctx.Config.Build.Flags != "" {
cmd = append(cmd, strings.Fields(ctx.Config.Build.Flags)...)
@ -88,7 +88,7 @@ func run(target buildTarget, command, env []string) error {
log.WithField("target", target.PrettyString()).
WithField("env", env).
WithField("args", cmd.Args).
Debug("Running")
Debug("running")
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("build failed: %s\n%v", target.PrettyString(), string(out))
}

View File

@ -26,11 +26,13 @@ func (t buildTarget) PrettyString() string {
func buildTargets(ctx *context.Context) (targets []buildTarget) {
for _, target := range allBuildTargets(ctx) {
if !valid(target) {
log.WithField("target", target.PrettyString()).Warn("Skipped invalid build")
log.WithField("target", target.PrettyString()).
Warn("skipped invalid build")
continue
}
if ignored(ctx, target) {
log.WithField("target", target.PrettyString()).Warn("Skipped ignored build")
log.WithField("target", target.PrettyString()).
Warn("skipped ignored build")
continue
}
targets = append(targets, target)

View File

@ -49,7 +49,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
}
func checksums(ctx *context.Context, file *os.File, name string) error {
log.WithField("file", name).Info("Checksumming")
log.WithField("file", name).Info("checksumming")
var artifact = filepath.Join(ctx.Config.Dist, name)
sha, err := checksum.SHA256(artifact)
if err != nil {

4
pipeline/env/env.go vendored
View File

@ -25,11 +25,11 @@ func (Pipe) Description() string {
func (Pipe) Run(ctx *context.Context) (err error) {
ctx.Token = os.Getenv("GITHUB_TOKEN")
if !ctx.Publish {
log.Warn("GITHUB_TOKEN not validated because publishing has been disabled")
log.Warn("github token not validated because publishing has been disabled")
return nil
}
if !ctx.Validate {
log.Warn("Skipped validations because --skip-validate is set")
log.Warn("skipped validations because --skip-validate is set")
return nil
}
if ctx.Token == "" {

View File

@ -30,7 +30,7 @@ func (Pipe) Description() string {
// Run the pipe
func (Pipe) Run(ctx *context.Context) error {
if len(ctx.Config.FPM.Formats) == 0 {
log.Info("No output formats configured, skipping")
log.Info("no output formats configured, skipping")
return nil
}
_, err := exec.LookPath("fpm")

View File

@ -73,7 +73,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
return
}
if !ctx.Validate {
log.Warn("Skipped validations because --skip-validate is set")
log.Warn("skipped validations because --skip-validate is set")
return nil
}
return validate(ctx, commit, tag)
@ -169,7 +169,7 @@ func gitLog(refs ...string) (string, error) {
func getInfo() (tag, commit string, err error) {
tag, err = cleanGit("describe", "--tags", "--abbrev=0")
if err != nil {
log.WithError(err).Info("Failed to retrieve current tag")
log.WithError(err).Info("failed to retrieve current tag")
}
commit, err = cleanGit("show", "--format='%H'", "HEAD")
return

View File

@ -27,12 +27,12 @@ func (Pipe) Run(ctx *context.Context) error {
func doRun(ctx *context.Context, client client.Client) error {
if !ctx.Publish {
log.Warn("Skipped because --skip-publish is set")
log.Warn("skipped because --skip-publish is set")
return nil
}
log.WithField("tag", ctx.Git.CurrentTag).
WithField("repo", ctx.Config.Release.GitHub.String()).
Info("Creating or updating release")
Info("creating or updating release")
body, err := describeBody(ctx)
if err != nil {
return err
@ -58,6 +58,6 @@ func upload(ctx *context.Context, client client.Client, releaseID int, artifact
return err
}
defer func() { _ = file.Close() }()
log.WithField("file", file).Info("Uploading")
log.WithField("file", file.Name()).Info("uploading")
return client.Upload(ctx, releaseID, artifact, file)
}