diff --git a/.gitignore b/.gitignore index fea9d0b2..4f6c7b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ go.work /bin -/harbor \ No newline at end of file +/harbor +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..864ff7a7 --- /dev/null +++ b/.goreleaser.yaml @@ -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:" diff --git a/cmd/harbor/internal/version/version.go b/cmd/harbor/internal/version/version.go new file mode 100644 index 00000000..ea93c6a9 --- /dev/null +++ b/cmd/harbor/internal/version/version.go @@ -0,0 +1,10 @@ +package version + +var ( + Version = "0.1.0" + GitCommit = "" +) + +func GetVersion() string { + return Version +} diff --git a/main.go b/main.go deleted file mode 100644 index 96959a41..00000000 --- a/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "os" - - "github.com/akshatdalton/harbor-cli/cmd" -) - -func main() { - harborCLI := cmd.CreateHarborCLI() - if err := harborCLI.Execute(); err != nil { - os.Exit(1) - } -}