attempt to AutogenSave() files
This commit is contained in:
parent
02bce38b78
commit
ffade519ff
22
doRelease.go
22
doRelease.go
|
@ -58,12 +58,20 @@ func doRelease() bool {
|
||||||
|
|
||||||
log.Info("\ttag and push", curName, me.release.version.String(), me.releaseReasonS)
|
log.Info("\ttag and push", curName, me.release.version.String(), me.releaseReasonS)
|
||||||
|
|
||||||
|
if err := check.ValidGoSum(); err != nil {
|
||||||
|
log.Info("ValidGoSum() error", check.GoPath, err)
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
var all [][]string
|
var all [][]string
|
||||||
|
var autogen []string
|
||||||
all = append(all, []string{"git", "add", "-f", "go.mod"})
|
all = append(all, []string{"git", "add", "-f", "go.mod"})
|
||||||
if ok, _ := check.IsPrimitive(); ok {
|
autogen = append(autogen, "go.mod")
|
||||||
|
if check.GoPrimitive {
|
||||||
// don't add go.sum here. TODO: check for go.sum file and fail
|
// don't add go.sum here. TODO: check for go.sum file and fail
|
||||||
} else {
|
} else {
|
||||||
all = append(all, []string{"git", "add", "-f", "go.sum"})
|
all = append(all, []string{"git", "add", "-f", "go.sum"})
|
||||||
|
autogen = append(autogen, "go.sum")
|
||||||
}
|
}
|
||||||
if ok, compiled, err := me.current.IsProtobuf(); ok {
|
if ok, compiled, err := me.current.IsProtobuf(); ok {
|
||||||
log.Info("\tIsProtobuf() == true")
|
log.Info("\tIsProtobuf() == true")
|
||||||
|
@ -77,6 +85,7 @@ func doRelease() bool {
|
||||||
for _, s := range compiled {
|
for _, s := range compiled {
|
||||||
log.Info("\tcompiled file found:", s)
|
log.Info("\tcompiled file found:", s)
|
||||||
all = append(all, []string{"git", "add", "-f", s})
|
all = append(all, []string{"git", "add", "-f", s})
|
||||||
|
autogen = append(autogen, s)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Info("\tIsProtobuf() == false")
|
log.Info("\tIsProtobuf() == false")
|
||||||
|
@ -86,6 +95,13 @@ func doRelease() bool {
|
||||||
all = append(all, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()})
|
all = append(all, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()})
|
||||||
all = append(all, []string{"git", "push", "origin", me.release.version.String()})
|
all = append(all, []string{"git", "push", "origin", me.release.version.String()})
|
||||||
|
|
||||||
|
// save the autogenerated files in git metadata (aka: notes)
|
||||||
|
cname := check.GetCurrentBranchName()
|
||||||
|
if err := check.AutogenSave(autogen, cname, true); err != nil {
|
||||||
|
log.Info("AutogenSave() error", err)
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
if !me.current.Status.DoAll(all) {
|
if !me.current.Status.DoAll(all) {
|
||||||
log.Info("failed to make new release", me.release.version.String())
|
log.Info("failed to make new release", me.release.version.String())
|
||||||
findOk = false
|
findOk = false
|
||||||
|
@ -137,6 +153,10 @@ func doRelease() bool {
|
||||||
retag = append(retag, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()})
|
retag = append(retag, []string{"git", "tag", "-m", me.releaseReasonS, me.release.version.String()})
|
||||||
retag = append(retag, []string{"git", "push", "origin", me.release.version.String()})
|
retag = append(retag, []string{"git", "push", "origin", me.release.version.String()})
|
||||||
|
|
||||||
|
if err := check.AutogenRestore(cname); err != nil {
|
||||||
|
log.Info("AutogenRestore() failed", err)
|
||||||
|
}
|
||||||
|
|
||||||
if !me.current.Status.DoAll(retag) {
|
if !me.current.Status.DoAll(retag) {
|
||||||
log.Info("retag failed")
|
log.Info("retag failed")
|
||||||
findOk = false
|
findOk = false
|
||||||
|
|
Loading…
Reference in New Issue