Skip to content

perf: makefile add upload and fix TARSBUILD #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion hack/scripts/makefile.tars.gomod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ tar: $(TARGET) $(CONFIG)
echo "tar cvfz $(TARGET).tgz ..."; \
fi

TARS_WEB_HOST ?= http://localhost:3000
TARS_WEB_TOKEN ?= ""
UPLOAD_USER ?= $(shell whoami)
UPLOAD_OS ?= linux
upload: export GOOS=${UPLOAD_OS}
upload: tar
@echo "$(TARGET).tgz --- $(APP).$(TARGET).tgz OS: ${GOOS}"
curl ${TARS_WEB_HOST}/api/upload_and_publish?ticket=${TARS_WEB_TOKEN} -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fcomment=uploaded-by-${UPLOAD_USER}
@echo "\n---------------------------------------------------------------------------\n"


HELP += $(HELP_TAR)

Expand All @@ -117,7 +127,7 @@ HELP_CLEANALL = "\n\033[1;33mcleanall\033[0m:\t[clean & rm .*.d]"
HELP_TAR = "\n\033[1;33mtar\033[0m:\t\t[will do 'tar $(TARGET).tgz $(RELEASE_FILE)']"

help:
@echo -e $(HELP)"\n"
@echo $(HELP)"\n"

#-------------------------------------------------------------------------------
tars2go:
Expand Down
4 changes: 2 additions & 2 deletions tars/tools/tarsgo/internal/base/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ make
./{{.Server}} --config=config/config.conf
`

makefileTemplateFile = "makefile"
makefileTemplateFile = "Makefile"
makefileTemplate = `APP := {{.App}}
TARGET := {{.Server}}
MFLAGS :=
Expand Down Expand Up @@ -283,5 +283,5 @@ func DoGenProject(p *Project, to string, mgrType string) error {
if mgrType == consts.CMake {
return bindata.RestoreAssets(to, "cmake")
}
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod")
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod.mk")
}
6 changes: 3 additions & 3 deletions tars/tools/tarsgo/internal/bindata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tars/tools/tarsgo/internal/consts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package consts
// Release is the current tarsgo tool version.
const (
RepoURL = "https://github.com/TarsCloud/TarsGo.git"
Release = "v1.3.5"
Release = "v1.3.6"
MakeDemoDir = "Demo4GoMod"
//CMakeDemoDir = "Demo4Cmake"
Make = "make"
Expand Down