Skip to content

Commit

Permalink
inject the version on building
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Oct 28, 2023
1 parent f5e70be commit c97557b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
22 changes: 20 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,32 @@ before:
- go generate ./...

builds:
- env:
- id: rdsmysql
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/rdsmysql

binary: rdsmysql
ldflags:
- -s
- -w
- -X main.version={{.Version}}
- id: rdsmysqldump
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/rdsmysqldump
binary: rdsmysqldump
ldflags:
- -s
- -w
- -X main.version={{.Version}}
archives:
- format: tar.gz
# use zip for windows archives
Expand Down
22 changes: 20 additions & 2 deletions v2/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,32 @@ before:
- go generate ./...

builds:
- env:
- id: rdsmysql
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/rdsmysql

binary: rdsmysql
ldflags:
- -s
- -w
- -X main.version={{.Version}}
- id: rdsmysqldump
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/rdsmysqldump
binary: rdsmysqldump
ldflags:
- -s
- -w
- -X main.version={{.Version}}
archives:
- format: tar.gz
# use zip for windows archives
Expand Down

0 comments on commit c97557b

Please sign in to comment.