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
}
// run go-mod-clean on every repo to start
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)
}
}
@ -71,19 +70,32 @@ func makePrepareRelease() {
if master != lastTag {
// 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)
}
continue
}
// if the repo is a go binary, try forcing new go.* files
if check.RepoType() == "binary" {
// check if the package dependancies changed, if so, re-publish
if me.forge.FinalGoDepsCheckOk(check) {
log.Printf("go.sum is perfect! %s\n", check.GetGoPath())
} else {
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()
}
if check.RepoType() != "binary" {
// master and lasttag match and it's not a binary. everything is fine
continue
}
// check if the package dependancies changed, if so, re-publish
if me.forge.FinalGoDepsCheckOk(check) {
log.Printf("go.sum is perfect! %s\n", check.GetGoPath())
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)
}
}