more release version automation

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-27 13:06:57 -06:00
parent e6cb846ccf
commit 7bcbca3fce
4 changed files with 42 additions and 43 deletions

60
draw.go
View File

@ -134,6 +134,7 @@ func (rs *RepoStatus) drawGitStatus() {
rs.dirtyLabel = gadgets.NewOneLiner(newgrid, "dirty")
rs.readOnly = gadgets.NewOneLiner(newgrid, "read only")
rs.goSumStatus = gadgets.NewOneLiner(newgrid, "go mod status")
rs.targetReleaseVersion = gadgets.NewOneLiner(newgrid, "target release version")
rs.speed = gadgets.NewOneLiner(newgrid, "refresh speed =")
rs.speedActual = gadgets.NewOneLiner(newgrid, "speed actual =")
@ -161,6 +162,24 @@ func (rs *RepoStatus) runDevelMergeB() bool {
return true
}
func (rs *RepoStatus) runReleaseVersionB() bool {
if !rs.generateCmd() {
log.Warn("something is wrong. fix the errors first")
return false
}
rs.releaseVersion.Disable()
log.Warn("MAKING A RELEASE AND VERSION")
if !rs.runGitCommands(true) {
log.Warn("SOMETHING WENT WRONG")
rs.Update()
rs.Enable()
return false
}
log.Warn("THINGS SEEM OK. runReleaseVersionB worked. Release is finished. restart autotypist()")
rs.Hide()
return true
}
func (rs *RepoStatus) runFullAutomation() bool {
if ! rs.runDevelMergeB() {
log.Warn("THINGS FAILED returned false")
@ -180,6 +199,13 @@ func (rs *RepoStatus) runFullAutomation() bool {
log.Warn("THINGS SEEM OK ready to release")
if rs.releaseVersion.String() == "Release!" {
log.Warn("releaseVersion == 'Release!'. safe to do release version HERE?")
log.Warn("rs.newversion =", rs.newversion.String())
log.Warn("rs.targetReleaseVersion =", rs.targetReleaseVersion.String())
log.Warn("Are these equal?")
if rs.newversion.String() == rs.targetReleaseVersion.String() {
log.Warn("THEY ARE EQUAL!")
// rs.runReleaseVersionB()
}
}
}
return true
@ -233,41 +259,11 @@ func (rs *RepoStatus) drawGitCommands() {
log.Warn("THINGS FAILED fullAutomation() returned false")
}
rs.Enable()
/*
rs.Disable()
master := rs.mainWorkingName.String()
log.Warn("develMerge() checking out master branch", master)
rs.checkoutBranch("master", master)
if rs.getCurrentBranchName() != master {
log.Warn("something went wrong switching to the master branch. full stop!")
return
}
log.Warn("develMerge() running runGitCommands()")
if !rs.runGitCommands(true) {
log.Warn("SOMETHING WENT WRONG")
return
}
rs.Update()
rs.Enable()
log.Warn("THINGS SEEM OK runGitCommands() returned true")
*/
})
rs.releaseVersion = newgrid.NewButton("tag and release new version", func() {
rs.Disable()
if !rs.generateCmd() {
log.Warn("something is wrong. fix the errors first")
return
}
rs.releaseVersion.Disable()
log.Warn("MAKING A RELEASE AND VERSION")
if !rs.runGitCommands(true) {
log.Warn("SOMETHING WENT WRONG")
}
rs.Update()
rs.Enable()
log.Warn("THINGS SEEM OK")
rs.runReleaseVersionB()
})
newgrid.Margin()
@ -289,6 +285,8 @@ func (rs *RepoStatus) SetVersion(a, b, c string, reason string) {
releaseRevision = c
rs.setRevision(c)
rs.targetReleaseVersion.SetText(a + "." + b + "." + c)
rs.versionMessage.SetLabel(reason)
rs.versionMessage.SetText(reason)
// rs.versionMessage.SetValue(reason)

8
go.mod
View File

@ -3,10 +3,10 @@ module go.wit.com/lib/gui/repostatus
go 1.21.4
require (
go.wit.com/gui v0.13.14
go.wit.com/lib/gadgets v0.13.16
go.wit.com/log v0.13.0
go.wit.com/widget v1.1.8
go.wit.com/gui v0.13.18
go.wit.com/lib/gadgets v0.13.18
go.wit.com/log v0.13.18
go.wit.com/widget v1.1.9
)
require (

16
go.sum
View File

@ -4,11 +4,11 @@ go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
go.wit.com/gui v0.13.14 h1:tJMCtZ8fJNmNB7oq4GQkciTA5aKUYlHL7U2tULIzwKU=
go.wit.com/gui v0.13.14/go.mod h1:mrITA5sK/wdrUKP33B1cJ8IJ7WGda9iGHEFmxPhxGCE=
go.wit.com/lib/gadgets v0.13.16 h1:ljW/hL+9jmndGs6ctDugqyTE6xOxmUlL5PcCw5pL+GQ=
go.wit.com/lib/gadgets v0.13.16/go.mod h1:5DHlhVpm09nfO0ZdwlfrMQt/6d+qm8c5ysR2ghT99/o=
go.wit.com/log v0.13.0 h1:0vyW3mHwDww3wCsyGnmQuX2P4V7aBMoJgxCy0GfA20g=
go.wit.com/log v0.13.0/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
go.wit.com/widget v1.1.8 h1:5cHcmfgwCyHjf02Af/9UMrbLhBR7Z/LFAjPuCx4dx5A=
go.wit.com/widget v1.1.8/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
go.wit.com/gui v0.13.18 h1:r4z1FNg6AxGWfq13+na4Xu/uA8PTTtDGka0ajo29omk=
go.wit.com/gui v0.13.18/go.mod h1:SRcfZKSbBWUxyyDiqlISWEYySoeATnijVxhzRIF0xiE=
go.wit.com/lib/gadgets v0.13.18 h1:Z35WCI6BtRamRkLTWaUP5/9+BnOGGbRdnD95SnnM6Tw=
go.wit.com/lib/gadgets v0.13.18/go.mod h1:hU0cXWfyvBrxmKD37MLyjOfJRK4+cU1aJ6lLx1CM0Qo=
go.wit.com/log v0.13.18 h1:XJNaQWX+8m12p3mH+kYih3zNjb0kScZDFpJa4c2TvKE=
go.wit.com/log v0.13.18/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
go.wit.com/widget v1.1.9 h1:iltjAL8UZu0YPfia8/qyfDx04BDxhj8rURcx0OHVBEc=
go.wit.com/widget v1.1.9/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=

View File

@ -49,6 +49,7 @@ type RepoStatus struct {
versionMessage *gadgets.BasicEntry
versionCmds [][]string
versionCmdOutput *gadgets.OneLiner
targetReleaseVersion *gadgets.OneLiner
newversion *gui.Node