From 3842ba6708b389c2ca9104dfa4459b722c25dde8 Mon Sep 17 00:00:00 2001 From: rohitagg2020 <55523204+rohitagg2020@users.noreply.github.com> Date: Tue, 7 Feb 2023 13:19:53 +0530 Subject: [PATCH] Move release process to goreleaser (#698) * Move release process to goreleaser Signed-off-by: rohitagg2020 * Fixing the spaces Signed-off-by: rohitagg2020 * Removing unnecessary command Signed-off-by: rohitagg2020 * Using commit instead of tag Signed-off-by: rohitagg2020 --------- Signed-off-by: rohitagg2020 --- .github/workflows/release.yml | 2 +- .goreleaser.yml | 9 +++++++-- hack/build-binaries.sh | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92e09a336..5e7fccdcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,7 +102,7 @@ jobs: EOF ) - - name: Run Test cases + - name: Run Test cases run: | # Setup minikube curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 diff --git a/.goreleaser.yml b/.goreleaser.yml index db57a7033..20cbbd5c3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,6 +2,8 @@ # Make sure to check the documentation at http://goreleaser.com before: hooks: + - go fmt ./cmd/... ./pkg/... ./test/... + - go mod vendor - go mod tidy builds: - env: @@ -13,6 +15,9 @@ builds: goarch: - amd64 - arm64 + ignore: + - goos: windows + goarch: arm64 main: ./cmd/kapp binary: kapp-{{ .Os }}-{{ .Arch }} @@ -40,8 +45,8 @@ snapshot: release: # Repo in which the release will be created. github: - owner: vmware-tanzu - name: carvel-kapp + owner: carvel-dev + name: kapp # If set to true, will not auto-publish the release. draft: true diff --git a/hack/build-binaries.sh b/hack/build-binaries.sh index 5623ceb62..39bd797aa 100755 --- a/hack/build-binaries.sh +++ b/hack/build-binaries.sh @@ -2,14 +2,16 @@ set -e -x -u -./hack/build.sh - function get_latest_git_tag { git describe --tags | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' } VERSION="${1:-`get_latest_git_tag`}" +go fmt ./cmd/... ./pkg/... ./test/... +go mod vendor +go mod tidy + # makes builds reproducible export CGO_ENABLED=0 LDFLAGS="-X github.com/vmware-tanzu/carvel-kapp/pkg/kapp/version.Version=$VERSION -buildid="