Skip to content

Commit

Permalink
replaced github-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevoo committed Sep 2, 2024
1 parent 2ac5718 commit aeb29ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aeb29ee

Please sign in to comment.