add --minor argv. will it work?

This commit is contained in:
Jeff Carr 2024-12-15 08:46:23 -06:00
parent 7bfd240649
commit 139653ba8c
3 changed files with 21 additions and 12 deletions

View File

@ -14,27 +14,25 @@ vet:
build: build:
echo "build it!" echo "build it!"
touch resources/blank.so
-rm resources/*.so -rm resources/*.so
-mkdir resources/ -mkdir resources/
cp -a ~/go/src/go.wit.com/toolkits/*/*.so resources/ -cp -a ~/go/src/go.wit.com/toolkits/*/*.so resources/
touch resources/blank.so
GO111MODULE=off go build \ GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: goimports install: goimports
touch resources/blank.so
-rm resources/*.so -rm resources/*.so
cp -a ~/go/src/go.wit.com/toolkits/*/*.so resources/ -cp -a ~/go/src/go.wit.com/toolkits/*/*.so resources/
touch resources/blank.so
GO111MODULE=off go install \ GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
check-git-clean: check-git-clean:
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)
redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
go mod edit -go=1.20
curl-help: curl-help:
curl --silent http://localhost:9419/help curl --silent http://localhost:9419/help

View File

@ -12,6 +12,7 @@ type args struct {
// Release bool `arg:"--release" help:"do a release an exit"` // Release bool `arg:"--release" help:"do a release an exit"`
DryRun bool `arg:"--dry-run,env:DRYRUN" help:"don't actually do the release"` DryRun bool `arg:"--dry-run,env:DRYRUN" help:"don't actually do the release"`
Fix bool `arg:"--fix" help:"run fixGoMod() on startup"` Fix bool `arg:"--fix" help:"run fixGoMod() on startup"`
Minor bool `arg:"--minor" help:"increment minor verion numbers"`
Reason string `arg:"--reason" help:"tag message"` Reason string `arg:"--reason" help:"tag message"`
DumpVersions bool `arg:"--dump-versions" help:"dump the versions file for go.wit.com"` DumpVersions bool `arg:"--dump-versions" help:"dump the versions file for go.wit.com"`
Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"` Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"`

View File

@ -41,8 +41,13 @@ func makePrepareRelease() {
master := check.GetMasterVersion() master := check.GetMasterVersion()
lastTag := check.GetLastTag() lastTag := check.GetLastTag()
if master != lastTag { if master != lastTag {
// if v1.2.3 change to v.1.2.4 if argv.Minor {
check.IncrementTargetRevision() // if v1.2.3 change to v.1.3.0
check.IncrementTargetMinor()
} else {
// if v1.2.3 change to v.1.2.4
check.IncrementTargetRevision()
}
if !runGoClean(check) { if !runGoClean(check) {
log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath) log.Info("go-mod-clean FAILED. THIS IS BAD.", check.GoPath)
} }
@ -58,8 +63,13 @@ func makePrepareRelease() {
continue continue
} }
log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
// if v1.2.3 change to v.1.2.4 if argv.Minor {
check.IncrementTargetRevision() // if v1.2.3 change to v.1.3.0
check.IncrementTargetMinor()
} else {
// if v1.2.3 change to v.1.2.4
check.IncrementTargetRevision()
}
// run go-mod-clean in each repo that needs to be updated // run go-mod-clean in each repo that needs to be updated
if master == lastTag { if master == lastTag {
// 'git notes' has something in it. clear it out // 'git notes' has something in it. clear it out