blob: 9262a07dc98bc9344c39c45492379abaf9d8c471 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
package main
import (
"os"
"go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
func doSingleRepo(myRepoName string) {
// the repo from the command line
var myrepo *repolist.RepoRow
// find myself. the guireleaser directory is used as a working scratchpad
// for running go commands that can mess up the go.* files
// for _, repo := range me.repos.View.AllRepos() {
myrepo = me.repos.View.FindRepoByName(myRepoName)
me.mainWindow.Disable()
defer me.mainWindow.Enable()
if myrepo == nil {
log.Info("could not find", myargs.Repo)
}
log.Info("only going to do repo:", myrepo.GoPath())
tmp := myargs.Reason
if tmp == "" {
tmp = os.Getenv("GUIRELEASE_REASON")
}
if tmp == "" {
tmp = "made by guireleaser"
}
// increment all the versions
for _, repo := range me.repos.View.AllRepos() {
if whitelist(repo.GoPath()) {
continue
}
if repo.ReadOnly() {
continue
}
lasttag := repo.Status.LastTag()
if repo.Status.GetCurrentVersion() == lasttag {
log.Info("skipping unchanged repo", repo.Status.GoPath())
repo.Status.SetTargetVersion(lasttag)
continue
}
repo.Status.IncrementRevisionVersion("go-clone")
}
// rescan all the repos
me.repos.View.ScanRepositories()
myrepo.Status.MakeRedomod()
myrepo.Status.IncrementRevisionVersion(tmp)
_, err := me.repos.View.CheckValidGoSum(myrepo)
if err != nil {
log.Info("go mod tidy not ok", err)
return
}
if !checkValidGoSum(myrepo) {
log.Info("go.sum checks failed")
os.Exit(0)
}
setCurrentRepo(myrepo, "should be good to release", "pretty sure")
log.Info("DO THE RELEASE HERE")
log.Info("going to release", myrepo.GoPath(), "as version", myrepo.Status.GetTargetVersion())
if myargs.DryRun {
log.Info("--dry-run == true")
} else {
log.Info("--dry-run == true")
// doRelease()
}
}
|