diff options
| author | Jeff Carr <[email protected]> | 2025-10-30 16:14:41 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-30 16:14:41 -0500 |
| commit | 78212e63806da6528b56a1c9f678d3ae59e8ebc2 (patch) | |
| tree | 4db2fb223588e971b6cc230bfebfc4a47899cdc4 /doPublish.go | |
| parent | 7787400035d2e764caac766dc75111e1683e5537 (diff) | |
actually published a repo using this code
Diffstat (limited to 'doPublish.go')
| -rw-r--r-- | doPublish.go | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/doPublish.go b/doPublish.go index efa8af2..9b11ddd 100644 --- a/doPublish.go +++ b/doPublish.go @@ -9,6 +9,7 @@ import ( "go.wit.com/lib/env" "go.wit.com/lib/protobuf/argvpb" + "go.wit.com/log" ) func doPublish() error { @@ -16,11 +17,43 @@ func doPublish() error { // 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) + if publish == nil { + return errors.New("nothing to publish. you actually have to write code first") } + + for repo := range publish.IterAll() { + // update the target version + // repo.IncrementTargetMinor() + repo.IncrementTargetRevision() + } + + publish = publish.SortActual() + footer := publish.PrintPublishNewTB() + fmt.Printf("publish.len(%d) PrintPublishTable() footer: %s\n", publish.Len(), footer) + + tryme := findNext(publish) + if len(tryme) == 0 { + return errors.New("can't find something safe to publish") + } + + startRepo := me.forge.Repos.FindByNamespace("go.wit.com/lib/xgb") + if startRepo == nil { + return errors.New("a startRepo can't be found") + } + + releaseReason := "new attempt" + + for i, repo := range tryme { + log.Info("tryme:", i, repo.FullPath) + if env.True("--doit") { + err := doRelease(repo, startRepo, releaseReason) + if err != nil { + return err + } + } + log.Printf("WOULD HAVE RUN: doRelease(%s, %s, %s) %s\n", repo.Namespace, startRepo.Namespace, releaseReason, repo.GetTargetVersion()) + } + if !env.True("--doit") { return errors.New("run with --doit to actually try to publish") } |
