2024-01-09 01:16:00 -06:00
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-15 08:11:08 -06:00
|
|
|
"embed"
|
2024-01-26 02:04:19 -06:00
|
|
|
"fmt"
|
2024-02-02 17:04:57 -06:00
|
|
|
"strings"
|
2024-01-26 02:04:19 -06:00
|
|
|
"time"
|
2024-01-09 10:21:58 -06:00
|
|
|
|
2024-01-18 05:03:04 -06:00
|
|
|
"go.wit.com/gui"
|
2024-02-09 11:50:16 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-09 01:16:00 -06:00
|
|
|
)
|
|
|
|
|
2024-02-09 11:50:16 -06:00
|
|
|
// TODO: autocompute these in the gui
|
2024-02-11 18:10:07 -06:00
|
|
|
var releaseReasonS string = "deb packager"
|
|
|
|
var releaseVersion string = "0.20.3"
|
|
|
|
var widgetVersion string = "1.1.18"
|
2024-02-09 11:50:16 -06:00
|
|
|
|
2024-01-15 21:11:28 -06:00
|
|
|
//go:embed resources/*
|
2024-01-15 08:11:08 -06:00
|
|
|
var resToolkit embed.FS
|
|
|
|
|
2024-01-09 01:16:00 -06:00
|
|
|
func main() {
|
2024-01-23 11:22:33 -06:00
|
|
|
me = new(autoType)
|
2024-01-24 22:22:34 -06:00
|
|
|
me.allrepos = make(map[string]*repo)
|
2024-01-18 05:03:04 -06:00
|
|
|
|
|
|
|
me.myGui = gui.New()
|
|
|
|
me.myGui.InitEmbed(resToolkit)
|
|
|
|
me.myGui.Default()
|
2024-01-09 01:16:00 -06:00
|
|
|
|
2024-01-30 14:05:22 -06:00
|
|
|
me.mainWindow = me.myGui.NewWindow("GUI release manager")
|
|
|
|
me.mainBox = me.mainWindow.NewBox("bw hbox", true)
|
|
|
|
|
|
|
|
globalDisplayOptions(me.mainBox)
|
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
repoworld()
|
2024-01-20 17:17:48 -06:00
|
|
|
|
2024-02-09 11:50:16 -06:00
|
|
|
me.releaseReasonS = releaseReasonS
|
2024-02-05 15:06:02 -06:00
|
|
|
|
2024-01-30 13:45:42 -06:00
|
|
|
for _, repo := range me.allrepos {
|
2024-01-31 02:27:17 -06:00
|
|
|
repo.status.UpdateCurrent()
|
2024-01-30 13:45:42 -06:00
|
|
|
repo.newScan()
|
2024-02-02 00:02:53 -06:00
|
|
|
|
|
|
|
if repo.String() == "go.wit.com/widget" {
|
2024-02-09 11:50:16 -06:00
|
|
|
repo.targetVersion.SetText("v" + widgetVersion)
|
2024-02-02 00:02:53 -06:00
|
|
|
} else {
|
2024-02-09 11:50:16 -06:00
|
|
|
repo.targetVersion.SetText("v" + releaseVersion)
|
2024-02-02 00:02:53 -06:00
|
|
|
}
|
2024-02-02 17:04:57 -06:00
|
|
|
if strings.HasPrefix(repo.String(), "go.wit.com/dev/") {
|
|
|
|
lasttag := repo.status.GetLastTagVersion()
|
|
|
|
repo.targetVersion.SetText(lasttag)
|
|
|
|
}
|
|
|
|
// if repo.String() == "go.wit.com/apps/guireleaser" {
|
2024-01-30 13:45:42 -06:00
|
|
|
}
|
2024-01-30 14:20:54 -06:00
|
|
|
log.Info("Creating the Release Window")
|
|
|
|
|
|
|
|
createReleaseBox(me.mainBox)
|
2024-01-31 05:04:18 -06:00
|
|
|
createUnreleaseBox(me.mainBox)
|
|
|
|
|
|
|
|
showHideRepos()
|
2024-01-30 14:20:54 -06:00
|
|
|
|
2024-01-30 13:59:40 -06:00
|
|
|
release.openrepo.Disable()
|
2024-01-30 13:45:42 -06:00
|
|
|
|
2024-01-26 02:04:19 -06:00
|
|
|
// scan repos every 30 seconds
|
|
|
|
// check every second for the checkbox changing
|
|
|
|
var i int = 60
|
2024-01-26 11:59:59 -06:00
|
|
|
myTicker(1*time.Second, "newScan()", func() {
|
2024-01-26 02:04:19 -06:00
|
|
|
i += 1
|
2024-01-26 11:59:59 -06:00
|
|
|
if !me.scanEveryMinute.Checked() {
|
2024-01-26 02:04:19 -06:00
|
|
|
if i < 60 {
|
|
|
|
i = 60
|
|
|
|
}
|
|
|
|
// print every 13 seconds
|
|
|
|
if i%13 == 0 {
|
|
|
|
log.Info("Not auto scanning", i)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if i < 60 {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
i = 0
|
|
|
|
duration := timeFunction(func() {
|
|
|
|
scanGoSum()
|
|
|
|
for _, repo := range me.allrepos {
|
|
|
|
repo.newScan()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
s := fmt.Sprint(duration)
|
|
|
|
me.autoWorkingPwd.SetText(s)
|
|
|
|
})
|
2024-01-09 01:16:00 -06:00
|
|
|
}
|