Skip to content

Commit

Permalink
feat(version): added version flag
Browse files Browse the repository at this point in the history
chore(gai): optimized binary size
  • Loading branch information
tnfssc committed Aug 17, 2024
1 parent ec9f63e commit 4e0405f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: -s -w -X main.version=${{ github.ref }}
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
go build -ldflags="-s -w -X main.version=develop"
pack:
upx --best --lzma gai

7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ import (
"github.com/tmc/langchaingo/llms/openai"
)

var version string

func main() {
if (os.Args[1] == "version") {
fmt.Println(version)
return
}

zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
debug := os.Getenv("DEBUG")
if debug == "true" {
Expand Down

0 comments on commit 4e0405f

Please sign in to comment.