keep trying to automate this

This commit is contained in:
Jeff Carr 2024-12-14 16:29:14 -06:00
parent 1c8f55d397
commit e214aff7db
1 changed files with 23 additions and 11 deletions

View File

@ -50,10 +50,9 @@ func makePrepareRelease() {
continue continue
} }
// run go-mod-clean on every repo to start
if !runGoClean(check) { if !runGoClean(check) {
log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath) log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath)
log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath)
log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath)
} }
} }
@ -71,19 +70,32 @@ func makePrepareRelease() {
if master != lastTag { if master != lastTag {
// if v1.2.3 change to v.1.2.4 // if v1.2.3 change to v.1.2.4
check.IncrementTargetRevision() check.IncrementTargetRevision()
if !runGoClean(check) {
log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath)
}
continue continue
} }
// if the repo is a go binary, try forcing new go.* files // if the repo is a go binary, try forcing new go.* files
if check.RepoType() == "binary" { if check.RepoType() != "binary" {
// check if the package dependancies changed, if so, re-publish // master and lasttag match and it's not a binary. everything is fine
if me.forge.FinalGoDepsCheckOk(check) { continue
log.Printf("go.sum is perfect! %s\n", check.GetGoPath()) }
} else { // check if the package dependancies changed, if so, re-publish
log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) if me.forge.FinalGoDepsCheckOk(check) {
// if v1.2.3 change to v.1.2.4 log.Printf("go.sum is perfect! %s\n", check.GetGoPath())
check.IncrementTargetRevision() continue
} }
log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
// 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 FAILED. THIS IS BAD.", check.GoPath)
} }
} }