diff options
| author | Jeff Carr <[email protected]> | 2025-10-30 14:03:03 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-30 14:03:03 -0500 |
| commit | 7787400035d2e764caac766dc75111e1683e5537 (patch) | |
| tree | 9153d01ffd3cb63011867512991d19e078a0aa3e /doPublish.go | |
| parent | cc1a5a7acfd0360c49f5710f0d90765f8bad9f8a (diff) | |
try fixing publish
Diffstat (limited to 'doPublish.go')
| -rw-r--r-- | doPublish.go | 98 |
1 files changed, 46 insertions, 52 deletions
diff --git a/doPublish.go b/doPublish.go index bd28a13..efa8af2 100644 --- a/doPublish.go +++ b/doPublish.go @@ -4,76 +4,70 @@ package main import ( + "errors" "fmt" - "os" - "time" - "go.wit.com/lib/fhelp" - "go.wit.com/lib/gui/shell" + "go.wit.com/lib/env" "go.wit.com/lib/protobuf/argvpb" - "go.wit.com/log" ) func doPublish() error { initForge() - saferepo := me.forge.Repos.FindByNamespace("go.wit.com/lib/xgb") // safe to run things here - if saferepo == nil { - return log.Errorf("need a safe place to run GO commands from") + // publish := me.forge.RunOnReposNewDumb(me.forge.Repos, rePrepareReleaseNew) // doesn't use Rill() + publish := me.forge.RunOnReposNew(me.forge.Repos, rePrepareReleaseNew) + if publish != nil { + publish = publish.SortActual() + footer := publish.PrintPublishNewTB() + fmt.Printf("publish.len(%d) PrintPublishTable() footer: %s\n", publish.Len(), footer) } - os.Chdir(saferepo.FullPath) + if !env.True("--doit") { + return errors.New("run with --doit to actually try to publish") + } + // me.forge.RillFuncError(rillPurge) - if os.Getenv("GUIRELEASE_REASON") == "" { - log.Info("$ENV[GUIRELEASE_REASON] was not set") - reason := fhelp.InputFromUser("set tag message:") - if reason == "" { - argvpb.BadExit("merge failed", fmt.Errorf("GUIRELEASE_REASON was blank")) + /* + saferepo := me.forge.Repos.FindByNamespace("go.wit.com/lib/xgb") // safe to run things here + if saferepo == nil { + return log.Errorf("need a safe place to run GO commands from") } - os.Setenv("GUIRELEASE_REASON", reason) - } + os.Chdir(saferepo.FullPath) - var cmd []string + if os.Getenv("GUIRELEASE_REASON") == "" { + log.Info("$ENV[GUIRELEASE_REASON] was not set") + reason := fhelp.InputFromUser("set tag message:") + if reason == "" { + argvpb.BadExit("merge failed", fmt.Errorf("GUIRELEASE_REASON was blank")) + } + os.Setenv("GUIRELEASE_REASON", reason) + } - cmd = []string{"forge", "merge", "--all"} - if _, err := shell.RunRealtimeError(cmd); err != nil { - argvpb.BadExit("merge failed", nil) - } + var cmd []string - cmd = []string{"forge", "merge", "check"} - if _, err := shell.RunRealtimeError(cmd); err != nil { - if _, err := shell.RunVerbose(cmd); err != nil { + cmd = []string{"forge", "merge", "--all"} + if _, err := shell.RunRealtimeError(cmd); err != nil { argvpb.BadExit("merge failed", nil) } - } - // todo: os.Stat() file - time.Sleep(time.Second) - me.forge.Repos.Load() - if err := doInstall(me.forge.Repos); err != nil { - log.Info("doInstall() failed", err) - argvpb.BadExit("merge failed", nil) - } + cmd = []string{"forge", "merge", "check"} + if _, err := shell.RunRealtimeError(cmd); err != nil { + if _, err := shell.RunVerbose(cmd); err != nil { + argvpb.BadExit("merge failed", nil) + } + } + // todo: os.Stat() file + time.Sleep(time.Second) + me.forge.Repos.Load() - if os.Getenv("GUIRELEASE_REASON") == "" { - os.Setenv("GUIRELEASE_REASON", "automated") - } - cmd = []string{"guireleaser", "--gui", "andlabs", "--auto-run"} - if argv.All { - // publish everything. don't be quick about it - // updates all go.mod and go.sum files for every repo - // that has dependancy changes. todo: only do binaries - } else { - // only publish packages that have commits - cmd = append(cmd, "quick") - } - if argv.Publish.Gomod { - // don't delete the .pb.go and go.* files from the master branch right away - cmd = append(cmd, "--keep-gomod") - } - if _, err := shell.RunRealtimeError(cmd); err != nil { - log.Info("releaser failed", err) - argvpb.BadExit("publishing failed", nil) - } + if err := doInstall(me.forge.Repos); err != nil { + log.Info("doInstall() failed", err) + argvpb.BadExit("merge failed", nil) + } + + if os.Getenv("GUIRELEASE_REASON") == "" { + os.Setenv("GUIRELEASE_REASON", "automated") + } + */ argvpb.GoodExit("PUBLISH WORKED") return nil |
