pull/30913/merge
Bhargavkonidena 3 months ago committed by GitHub
commit cb9e9bacb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,4 +6,3 @@ Output of `kubectl version`:
Cloud Provider/Platform (AKS, GKE, Minikube etc.): Cloud Provider/Platform (AKS, GKE, Minikube etc.):

@ -0,0 +1,38 @@
project_name: helm
builds:
- id: helm
main: ./cmd/helm
binary: helm
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
goarm:
- 6
env:
- CGO_ENABLED=0
- GOFLAGS=-trimpath
ldflags:
- -s -w -extldflags "-static"
flags:
- -tags=netgo
output: _dist/{{ .Os }}-{{ .Arch }}/helm
archives:
- id: default
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz
files:
- LICENSE
- README.md
- _dist/{{ .Os }}-{{ .Arch }}/helm
checksum:
name_template: checksums.txt
snapshot:
name_template: "{{ .Commit }}"

@ -31,14 +31,26 @@ jobs:
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # pin@5.5.0 uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # pin@5.5.0
with: with:
go-version: '${{ env.GOLANG_VERSION }}' go-version: '${{ env.GOLANG_VERSION }}'
- name: Run unit tests - name: Run unit tests
run: make test-coverage run: make test-coverage
- name: Build Helm Binaries - name: Build Helm Binaries
run: | run: |
set -eu -o pipefail set -eu -o pipefail
make build-cross VERSION="${{ github.ref_name }}" - name: Run Go Release
make dist checksum VERSION="${{ github.ref_name }}" uses: goreleaser/goreleaser-action@v6.3.0
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Verify checksum
run: |
make dist checksum VERSION="${{ github.ref_name }}"
- name: Set latest version - name: Set latest version
run: | run: |
@ -93,10 +105,18 @@ jobs:
- name: Run unit tests - name: Run unit tests
run: make test-coverage run: make test-coverage
- name: Build Helm Binaries - name: Run Go Release
uses: goreleaser/goreleaser-action@v6.3.0
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Verify checksum
run: | run: |
make build-cross make dist checksum VERSION="canary"
make dist checksum VERSION="canary"
- name: Upload Binaries - name: Upload Binaries
uses: bacongobbler/azure-blob-storage-upload@50f7d898b7697e864130ea04c303ca38b5751c50 # pin@3.0.0 uses: bacongobbler/azure-blob-storage-upload@50f7d898b7697e864130ea04c303ca38b5751c50 # pin@3.0.0

@ -1,15 +1,12 @@
BINDIR := $(CURDIR)/bin BINDIR := $(CURDIR)/bin
INSTALL_PATH ?= /usr/local/bin INSTALL_PATH ?= /usr/local/bin
DIST_DIRS := find * -type d -exec DIST_DIRS := find * -type d -exec
TARGETS := darwin/amd64 darwin/arm64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x linux/riscv64 windows/amd64 windows/arm64
TARGET_OBJS ?= darwin-amd64.tar.gz darwin-amd64.tar.gz.sha256 darwin-amd64.tar.gz.sha256sum darwin-arm64.tar.gz darwin-arm64.tar.gz.sha256 darwin-arm64.tar.gz.sha256sum linux-amd64.tar.gz linux-amd64.tar.gz.sha256 linux-amd64.tar.gz.sha256sum linux-386.tar.gz linux-386.tar.gz.sha256 linux-386.tar.gz.sha256sum linux-arm.tar.gz linux-arm.tar.gz.sha256 linux-arm.tar.gz.sha256sum linux-arm64.tar.gz linux-arm64.tar.gz.sha256 linux-arm64.tar.gz.sha256sum linux-ppc64le.tar.gz linux-ppc64le.tar.gz.sha256 linux-ppc64le.tar.gz.sha256sum linux-s390x.tar.gz linux-s390x.tar.gz.sha256 linux-s390x.tar.gz.sha256sum linux-riscv64.tar.gz linux-riscv64.tar.gz.sha256 linux-riscv64.tar.gz.sha256sum windows-amd64.zip windows-amd64.zip.sha256 windows-amd64.zip.sha256sum windows-arm64.zip windows-arm64.zip.sha256 windows-arm64.zip.sha256sum
BINNAME ?= helm BINNAME ?= helm
GOBIN = $(shell go env GOBIN) GOBIN = $(shell go env GOBIN)
ifeq ($(GOBIN),) ifeq ($(GOBIN),)
GOBIN = $(shell go env GOPATH)/bin GOBIN = $(shell go env GOPATH)/bin
endif endif
GOX = $(GOBIN)/gox
GOIMPORTS = $(GOBIN)/goimports GOIMPORTS = $(GOBIN)/goimports
ARCH = $(shell go env GOARCH) ARCH = $(shell go env GOARCH)
@ -131,8 +128,7 @@ test-source-headers:
@scripts/validate-license.sh @scripts/validate-license.sh
.PHONY: test-acceptance .PHONY: test-acceptance
test-acceptance: TARGETS = linux/amd64 test-acceptance: build build-linux-amd64
test-acceptance: build build-cross
@if [ -d "${ACCEPTANCE_DIR}" ]; then \ @if [ -d "${ACCEPTANCE_DIR}" ]; then \
cd ${ACCEPTANCE_DIR} && \ cd ${ACCEPTANCE_DIR} && \
ROBOT_RUN_TESTS=$(ACCEPTANCE_RUN_TESTS) ROBOT_HELM_PATH='$(BINDIR)' make acceptance; \ ROBOT_RUN_TESTS=$(ACCEPTANCE_RUN_TESTS) ROBOT_HELM_PATH='$(BINDIR)' make acceptance; \
@ -167,9 +163,6 @@ gen-test-golden: test-unit
# dependencies to the go.mod file. To avoid that we change to a directory # dependencies to the go.mod file. To avoid that we change to a directory
# without a go.mod file when downloading the following dependencies # without a go.mod file when downloading the following dependencies
$(GOX):
(cd /; go install github.com/mitchellh/gox@v1.0.2-0.20220701044238-9f712387e2d2)
$(GOIMPORTS): $(GOIMPORTS):
(cd /; go install golang.org/x/tools/cmd/goimports@latest) (cd /; go install golang.org/x/tools/cmd/goimports@latest)
@ -177,9 +170,13 @@ $(GOIMPORTS):
# release # release
.PHONY: build-cross .PHONY: build-cross
build-cross: LDFLAGS += -extldflags "-static" build-cross:
build-cross: $(GOX) @echo "==> Building cross-platform binaries using GoReleaser"
GOFLAGS="-trimpath" CGO_ENABLED=0 $(GOX) -parallel=3 -output="_dist/{{.OS}}-{{.Arch}}/$(BINNAME)" -osarch='$(TARGETS)' $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' ./cmd/helm goreleaser build --clean --skip-validate --single-target
.PHONY: build-linux-amd64
build-linux-amd64:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(GOFLAGS) -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINNAME)' ./cmd/helm
.PHONY: dist .PHONY: dist
dist: dist:

Loading…
Cancel
Save