diff --git a/Makefile b/Makefile index 5a45d86..5f0dbcd 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ safe-build: install forge list --private wit-test install --verbose # cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1 - cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs + rm -f go.* ; git checkout go.mod ; cd ~/go/src/go.wit.com/lib/xgb/ && time GUIRELEASE_REASON="safe-build" guireleaser --gui andlabs autocomplete: guireleaser --bash > ~/.local/share/bash-completion/completions/guireleaser diff --git a/argv.go b/argv.go index 515b7a0..8dfaffa 100644 --- a/argv.go +++ b/argv.go @@ -14,11 +14,10 @@ type args struct { Verbose bool `arg:"--verbose" help:"talk alot"` Full bool `arg:"--full" help:"build every package"` Reason string `arg:"--reason" help:"tag message"` + Force bool `arg:"--force" help:"try harder than normal"` Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"` Bash bool `arg:"--bash" help:"generate bash completion"` BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"` - // DumpVersions bool `arg:"--dump-versions" help:"dump the versions file for go.wit.com"` - // Fix bool `arg:"--fix" help:"run fixGoMod() on startup"` } type QuickCmd struct { diff --git a/doRelease.go b/doRelease.go index e2774d5..0847227 100644 --- a/doRelease.go +++ b/doRelease.go @@ -99,6 +99,23 @@ func doRelease() error { badExit(errors.New(msg)) } + // this is the final check. even here, just to be a total asshole + // I rerun go mod init and go mod tidy + // the re-parse all the results + // this is the last and final check. + // believe it or not, I've seen this fail. It's not worth being careful here + // or liberal about it. if it doesn't work, yep, you are stuck here you bastard + // (bastard being me. I designed this to be so annoying that if it makes it + // past this point it always works. that is the whole point of this code. NEVER + // EVER FAIL PAST THIS POINT + // ) + // so let's do it: let's run go-mod-clean strict + // then reparse everything + _, err := check.RunVerboseOnError([]string{"go-mod-clean", "strict"}) + if err != nil { + badExit(err) + } + var all [][]string var autogen []string all = append(all, []string{"git", "add", "-f", "go.mod"}) @@ -152,9 +169,9 @@ func doRelease() error { time.Sleep(3 * time.Second) // this can fail to update, try it again after sleep(3s) if !doPublishVersion() { - log.Info("PUBLISH FAILED") + log.Info("PUBLISH FAILED gopath=%s", check.GetGoPath()) findOk = false - return fmt.Errorf("PUBLISH FAILED %s", check.GetGoPath()) + return fmt.Errorf("PUBLISH FAILED gopath=%s", check.GetGoPath()) } } diff --git a/main.go b/main.go index 063fa2d..aa3fe33 100644 --- a/main.go +++ b/main.go @@ -106,7 +106,9 @@ func main() { if _, count, _, err := me.forge.IsEverythingOnMaster(); err != nil { log.Info("not everything is on the master branch (", count, "repos)") - os.Exit(-1) + if !argv.Force { + os.Exit(-1) + } } if me.startRepo == nil { diff --git a/prepareRelease.go b/prepareRelease.go index ff59fbd..aecac0e 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -38,7 +38,7 @@ func checkpkgcache(repo *gitpb.Repo) error { } getpath := repo.GetGoPath() + "@" + repo.GetLastTag() - log.Info("MISSING:", getpath) + log.Infof("~/go/pkg/mod/ IS MISSING %s so I'm running go get here.", getpath) _, err = me.startRepo.RunVerboseOnError([]string{"go", "get", getpath}) return err }