Skip to content

Commit

Permalink
feat: add goreleaser
Browse files Browse the repository at this point in the history
Signed-off-by: amands98 <amandeepsm.in@gmail.com>
  • Loading branch information
amands98 committed Feb 6, 2024
1 parent ef43a90 commit ff2a8b0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
go.work
/bin

/harbor
/harbor
dist/
37 changes: 37 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project_name: harbor

builds:
- main: ./cmd/harbor
binary: ./harbor
env:
- CGO_ENABLED=0
ldflags:
- -w -s -X github.com/goharbor/harbor-cli/cmd/harbor/internal/version.GitCommit={{.FullCommit}}
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- arm
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip
release:
draft: true
prerelease: auto

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
10 changes: 10 additions & 0 deletions cmd/harbor/internal/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package version

var (
Version = "0.1.0"
GitCommit = ""
)

func GetVersion() string {
return Version
}
14 changes: 0 additions & 14 deletions main.go

This file was deleted.

0 comments on commit ff2a8b0

Please sign in to comment.