add --release builds
This commit is contained in:
parent
c9f149bcb2
commit
38b1ecab60
30
Makefile
30
Makefile
|
@ -7,9 +7,15 @@ no-gui: build
|
|||
./go-deb --no-gui --repo go.wit.com/apps/autotypist
|
||||
|
||||
build:
|
||||
-mkdir resources
|
||||
-cp ~/go/src/go.wit.com/toolkits/*.so resources/
|
||||
GO111MODULE="off" go build -v
|
||||
|
||||
install:
|
||||
-mkdir resources
|
||||
-cp ~/go/src/go.wit.com/toolkits/*.so resources/
|
||||
GO111MODULE="off" go install -v
|
||||
|
||||
goimports:
|
||||
goimports -w *.go
|
||||
|
||||
|
@ -40,3 +46,27 @@ debian:
|
|||
|
||||
mirrors:
|
||||
-wit mirrors
|
||||
|
||||
build-all:
|
||||
go-deb --no-gui --repo go.wit.com/apps/autotypist
|
||||
go-deb --no-gui --repo go.wit.com/apps/control-panel-digitalocean
|
||||
go-deb --no-gui --repo go.wit.com/apps/control-panel-vpn
|
||||
go-deb --no-gui --repo go.wit.com/apps/go-gui-toolkits
|
||||
go-deb --no-gui --repo go.wit.com/apps/guireleaser
|
||||
go-deb --no-gui --repo go.wit.com/apps/control-panel-cloudflare
|
||||
go-deb --no-gui --repo go.wit.com/apps/control-panel-dns
|
||||
go-deb --no-gui --repo go.wit.com/apps/go-deb
|
||||
go-deb --no-gui --repo go.wit.com/apps/go.wit.com
|
||||
go-deb --no-gui --repo go.wit.com/apps/helloworld
|
||||
|
||||
build-releases:
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/autotypist
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/control-panel-digitalocean
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/control-panel-vpn
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/go-gui-toolkits
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/guireleaser
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/control-panel-cloudflare
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/control-panel-dns
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/go-deb
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/go.wit.com
|
||||
go-deb --release --no-gui --repo go.wit.com/apps/helloworld
|
||||
|
|
37
addRepo.go
37
addRepo.go
|
@ -25,12 +25,12 @@ func (c *controlBox) addRepo(path string) {
|
|||
return
|
||||
}
|
||||
|
||||
if repostatus.VerifyLocalGoRepo(path) {
|
||||
log.Verbose("path actually exists", path)
|
||||
} else {
|
||||
log.Warn("repostatus.VerifyLocalGoRepo() failed for for", path)
|
||||
return
|
||||
}
|
||||
// if repostatus.VerifyLocalGoRepo(path) {
|
||||
// log.Verbose("path actually exists", path)
|
||||
// } else {
|
||||
// log.Warn("repostatus.VerifyLocalGoRepo() failed for for", path)
|
||||
// return
|
||||
// }
|
||||
|
||||
c.pathL = gadgets.NewOneLiner(c.grid, "path")
|
||||
c.pathL.SetText(path)
|
||||
|
@ -54,10 +54,15 @@ func (c *controlBox) addRepo(path string) {
|
|||
c.tagDate = gadgets.NewOneLiner(c.grid, "git tag Date")
|
||||
c.grid.NextRow()
|
||||
|
||||
c.status = repostatus.NewRepoStatusWindow(path)
|
||||
c.status.SetMainWorkingName("master")
|
||||
c.status.SetDevelWorkingName("devel")
|
||||
c.status.SetUserWorkingName("jcarr")
|
||||
err, repo := repostatus.NewRepoStatusWindow(path)
|
||||
if err != nil {
|
||||
log.Info("path did not work", path, err)
|
||||
return
|
||||
}
|
||||
c.status = repo
|
||||
// c.status.SetMainWorkingName("master")
|
||||
// c.status.SetDevelWorkingName("devel")
|
||||
// c.status.SetUserWorkingName("jcarr")
|
||||
c.status.Update()
|
||||
|
||||
cbname := c.status.GetCurrentBranchName()
|
||||
|
@ -71,17 +76,23 @@ func (c *controlBox) addRepo(path string) {
|
|||
c.dirtyL.SetText("false")
|
||||
}
|
||||
|
||||
lasttag := c.status.GetLastTagVersion()
|
||||
if args.Release {
|
||||
debversion = lasttag
|
||||
debversion = strings.TrimPrefix(debversion, "v")
|
||||
c.dirtyL.SetText("false")
|
||||
}
|
||||
|
||||
c.Version.SetText(debversion)
|
||||
|
||||
lasttag := c.status.GetLastTagVersion()
|
||||
c.lastTag.SetText(lasttag)
|
||||
c.currentL.SetText(cbname + " " + cbversion)
|
||||
|
||||
tagDate := c.getDateStamp(lasttag)
|
||||
c.tagDate.SetText(tagDate)
|
||||
|
||||
if c.status.Changed() {
|
||||
log.Warn("should scan here")
|
||||
if s, ok := c.status.Changed(); ok {
|
||||
log.Warn("should scan here", s)
|
||||
}
|
||||
|
||||
return
|
||||
|
|
1
args.go
1
args.go
|
@ -16,6 +16,7 @@ var args struct {
|
|||
NoGui bool `arg:"--no-gui" help:"don't open the gui, just make the .deb"`
|
||||
Repo string `arg:"--repo" help:"go get path to the repo"`
|
||||
PkgDir string `arg:"--pkg-dir" help:"set default directory (~/incoming/)"`
|
||||
Release bool `arg:"--release" help:"build a release from the last git tag"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
2
main.go
2
main.go
|
@ -36,6 +36,7 @@ func main() {
|
|||
|
||||
// scan the repo
|
||||
cBox.addRepo(args.Repo)
|
||||
|
||||
// look for a 'config' file in the repo
|
||||
if cBox.readControlFile() == nil {
|
||||
log.Warn("scan worked")
|
||||
|
@ -50,6 +51,7 @@ func main() {
|
|||
log.Info("build worked")
|
||||
} else {
|
||||
log.Warn("build failed")
|
||||
os.Exit(-1)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
|
|
@ -60,6 +60,18 @@ func makebasicWindow() *gadgets.BasicWindow {
|
|||
func (c *controlBox) buildPackage() bool {
|
||||
// TODO: if dirty, set GO111MODULE
|
||||
// also, if last tag != version
|
||||
if args.Release {
|
||||
os.Unsetenv("GO111MODULE")
|
||||
path := c.pathL.String() + "@latest"
|
||||
cmd := []string{"go", "install", "-v", "-x", path}
|
||||
if shell.Run(cmd) {
|
||||
log.Warn("build worked")
|
||||
} else {
|
||||
log.Warn("build failed")
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
|
||||
if c.status.CheckDirty() {
|
||||
os.Setenv("GO111MODULE", "off")
|
||||
}
|
||||
|
@ -69,6 +81,7 @@ func (c *controlBox) buildPackage() bool {
|
|||
log.Warn("build failed")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
filename := c.Package.String()
|
||||
if filename == "" {
|
||||
|
@ -212,7 +225,8 @@ func (c *controlBox) computeControlValues() bool {
|
|||
// TODO: get this from gitea (or gitlab or github, etc)
|
||||
// or from the README.md ?
|
||||
if c.Description.String() == "" {
|
||||
c.Description.SetText("missing control file")
|
||||
path := c.pathL.String()
|
||||
c.Description.SetText("GO binary of " + path)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue