diff --git a/doRelease.go b/doRelease.go index a78602e..13e5208 100644 --- a/doRelease.go +++ b/doRelease.go @@ -147,13 +147,22 @@ func doPublishVersion() bool { log.Info("go.sum must exist here") me.release.guireleaser.Status.MakeRedomod() } - os.Unsetenv("GO111MODULE") - log.Info("TRYING TO SELF UPDATE HERE. cmd =", cmd) - err, out := me.release.guireleaser.Status.RunCmd(cmd) - if gopath == "go.wit.com/apps/guireleaser" { - // ignore errors on updating myself - log.Info("IGNORE SELF UPDATE ERROR. cmd =", cmd) + var err error + var out string + if me.current.Status.IsPrivate() { + // do not self update private repos err = nil + out = "This is a private repo and can not be self checked" + } else { + // publish go.mod & go.sum for use with go + os.Unsetenv("GO111MODULE") + log.Info("TRYING TO SELF UPDATE HERE. cmd =", cmd) + err, out = me.release.guireleaser.Status.RunCmd(cmd) + if gopath == "go.wit.com/apps/guireleaser" { + // ignore errors on updating myself + log.Info("IGNORE SELF UPDATE ERROR. cmd =", cmd) + err = nil + } } if err == nil { log.Info("SELF UPDATE OK. out =", out) diff --git a/setTargetVersion.go b/setTargetVersion.go index cf1090c..53d0abc 100644 --- a/setTargetVersion.go +++ b/setTargetVersion.go @@ -30,7 +30,13 @@ func setTargetVersion() { if repo.GoPath() == "go.wit.com/widget" { repo.Status.SetTargetVersion("v" + widgetVersion) } else { - repo.Status.SetTargetVersion("v" + releaseVersion) + prefix := "v" + releaseVersion + lasttag := repo.Status.LastTag() + if strings.HasPrefix(lasttag, prefix) { + repo.Status.SetTargetVersion(lasttag) + } else { + repo.Status.SetTargetVersion(prefix) + } } if strings.HasPrefix(repo.GoPath(), "go.wit.com/dev/") { lasttag := repo.Status.GetLastTagVersion()