diff options
Diffstat (limited to 'prepareRelease.go')
| -rw-r--r-- | prepareRelease.go | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/prepareRelease.go b/prepareRelease.go index 4c14bf5..060308d 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -1,6 +1,7 @@ package main import ( + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -41,16 +42,13 @@ func makePrepareRelease() { master := check.GetMasterVersion() lastTag := check.GetLastTag() if master != lastTag { - if argv.Minor { - // if v1.2.3 change to v.1.3.0 - check.IncrementTargetMinor() - } else { - // if v1.2.3 change to v.1.2.4 - check.IncrementTargetRevision() - } - if !runGoClean(check) { - log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath) - } + forceReleaseVersion(check) + continue + } + + if argv.Protobuf && check.RepoType() == "protobuf" { + // if --protobuf, this will force upgrade each one + forceReleaseVersion(check) continue } @@ -63,21 +61,7 @@ func makePrepareRelease() { continue } log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) - if argv.Minor { - // if v1.2.3 change to v.1.3.0 - check.IncrementTargetMinor() - } else { - // if v1.2.3 change to v.1.2.4 - check.IncrementTargetRevision() - } - // run go-mod-clean in each repo that needs to be updated - if master == lastTag { - // 'git notes' has something in it. clear it out - check.Run([]string{"git", "notes", "remove"}) - } - if !runGoClean(check) { - log.Info("go-mod-clean probably failed here. that's ok", check.GoPath) - } + forceReleaseVersion(check) } } @@ -94,3 +78,19 @@ func makePrepareRelease() { } } } + +func forceReleaseVersion(repo *gitpb.Repo) { + if argv.Minor { + // if v1.2.3 change to v.1.3.0 + repo.IncrementTargetMinor() + } else { + // if v1.2.3 change to v.1.2.4 + repo.IncrementTargetRevision() + } + // empty git notes + repo.Run([]string{"git", "notes", "remove"}) + + if !runGoClean(repo) { + log.Info("go-mod-clean probably failed here. that's ok", repo.GoPath) + } +} |
