Skip to content

Commit

Permalink
fix: display version information (#10)
Browse files Browse the repository at this point in the history
* version fix
  • Loading branch information
shyam-cb authored Mar 14, 2024
1 parent 7d6ecf3 commit fed06d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ builds:
- cmd: ditto -c -k --keepParent {{ .Path }} {{ .Path }}.zip
- cmd: xcrun notarytool submit {{ .Path }}.zip --apple-id {{ .Env.APPLE_ID }} --password {{ .Env.APPLE_APP_PASSWORD }} --team-id {{ .Env.APPLE_TEAM_ID }} --wait
- cmd: rm -rf {{ .Path }}.zip
- cmd: ditto -c -k {{ .Path }} {{ .Path }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.zip
- cmd: aws s3 cp {{ .Path }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.zip s3://{{ .Env.BUCKET_NAME }}/ --acl {{ .Env.BUCKET_ACL }}
- cmd: ditto -c -k {{ .Path }} {{ trimsuffix .Path ".exe" }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.zip
- cmd: aws s3 cp {{ trimsuffix .Path ".exe" }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.zip s3://{{ .Env.BUCKET_NAME }}/ --acl {{ .Env.BUCKET_ACL }}
release:
draft: false

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ setup:
APP_NAME := cbmigrate
VERSION := $(shell cat plugin.version)
build: clean
GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.Version=$(VERSION)'" -o builds/bin/linux_amd64/$(APP_NAME)
GOOS=linux GOARCH=arm64 go build -ldflags="-X 'main.Version=$(VERSION)'" -o builds/bin/linux_arm64/$(APP_NAME)
GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.Version=$(VERSION)'" -o builds/bin/darwin_amd64/$(APP_NAME)
GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'main.Version=$(VERSION)'" -o builds/bin/darwin_arm64/$(APP_NAME)
GOOS=windows GOARCH=amd64 go build -ldflags="-X 'main.Version=$(VERSION)'" -o builds/bin/windows_amd64/$(APP_NAME).exe
GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/linux_amd64/$(APP_NAME)
GOOS=linux GOARCH=arm64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/linux_arm64/$(APP_NAME)
GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/darwin_amd64/$(APP_NAME)
GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/darwin_arm64/$(APP_NAME)
GOOS=windows GOARCH=amd64 go build -ldflags="-X 'main.version=$(VERSION)'" -o builds/bin/windows_amd64/$(APP_NAME).exe
mkdir -p -m 777 builds/zip

zip -j builds/zip/$(APP_NAME)_$(VERSION)_linux_amd64.zip builds/bin/linux_amd64/$(APP_NAME)
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ func init() {
}

var (
Version = "" // - Ldflags will override this
version = "" // - Ldflags will override this
)

func main() {
common.SetVersion(Version)
common.SetVersion(version)
cmd.Execute()
}

0 comments on commit fed06d4

Please sign in to comment.