diff --git a/Makefile b/Makefile index bd40f0c..4b1c484 100644 --- a/Makefile +++ b/Makefile @@ -8,30 +8,31 @@ BINARY = gen NEWTAG := $(shell git describe --abbrev=0 --tags) OLDTAG := $(shell $(RELEASE_TOOL) release list -L 1 --json tagName -q ."[].tagName") -NIX_BINARIES = linux/amd64/$(BINARY) darwin/amd64/$(BINARY) -WIN_BINARIES = windows/amd64/$(BINARY).exe +NIX_BINARIES = linux-amd64-$(BINARY) darwin-amd64-$(BINARY) +WIN_BINARIES = windows-amd64-$(BINARY).exe COMPRESSED_BINARIES = $(NIX_BINARIES:%=%.bz2) $(WIN_BINARIES:%.exe=%.zip) COMPRESSED_TARGETS = $(COMPRESSED_BINARIES:%=target/%) temp = $(subst /, ,$@) -OS = $(word 2, $(temp)) -ARCH = $(word 3, $(temp)) +target = $(subst -, ,$(word 2, $(temp))) +OS = $(word 1, $(target)) +ARCH = $(word 2, $(target)) GITHASH = $(shell git log -1 --pretty=format:"%h") GOVER = $(word 3, $(shell go version)) LDFLAGS = -ldflags '-X main.version=$(NEWTAG) -X main.githash=$(GITHASH) -X main.golang=$(GOVER)' all: $(BINARY) -target/linux/amd64/$(BINARY) \ -target/darwin/amd64/$(BINARY) \ -target/windows/amd64/$(BINARY).exe: +target/linux-amd64-$(BINARY) \ +target/darwin-amd64-$(BINARY) \ +target/windows-amd64-$(BINARY).exe: CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build $(LDFLAGS) -o "$@" %.bz2: % - tar -cjf "$@" -C $(dir $<) $(BINARY) + tar -cjf $@ -C $(dir $<) $(notdir $<) %.zip: %.exe - zip -j "$@" "$<" + zip -j $@ $< # package main $(BINARY): @@ -45,8 +46,9 @@ install: release: ifneq ($(NEWTAG),$(OLDTAG)) $(MAKE) $(COMPRESSED_TARGETS) - git push && git push --tags && sleep 5 - $(foreach FILE, $(COMPRESSED_BINARIES), $(RELEASE_TOOL) release create --verify-tag --generate-notes $(NEWTAG) target/$(FILE);) + git push && git push --tags + git log --pretty=format:"%s" $(OLDTAG)...$(NEWTAG) | $(RELEASE_TOOL) release create --verify-tag $(NEWTAG) -F - || true + $(foreach FILE, $(COMPRESSED_BINARIES), $(RELEASE_TOOL) release upload $(NEWTAG) target/$(FILE);) endif clean: diff --git a/README.md b/README.md index 4e9fa54..2370329 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Plain text generation At the command line, you may have to put the prompt inside double quotes to avoid confusing the shell `$ gen "a scheme function to compute the Levenshtein distance between two strings; only the code"` -Pipe content into gen and save it in a text file +Pipe content into gen and save its output in a text file `$ cat cmd.go | gen -f - what does this code do? | tee report.txt` Obtain the token count @@ -48,7 +48,7 @@ System instruction and prompts as files from iterative Prisonner's Dilemma [pape Chain of thought `gen Please answer this question starting in two ways. First start with yes, then start with no and show your work. Afterwards determine which is correct. Is 3307 a prime number?` -Generate sequence diagram from code using PlantUML system instruction +Generate sequence diagram from code using PlantUML system instruction `gen -f puml.sprompt -f ~/lib/Duke/duke-core/src/main/java/no/priv/garshol/duke/Duke.java sequence diagram of the main_ method in this file` ## Multi-turn Example