From 94ed52b5418763b3618d7b57244cead6f79b842b Mon Sep 17 00:00:00 2001 From: Bence Csati Date: Tue, 3 Sep 2024 14:33:21 +0200 Subject: [PATCH] refactor(build): remove binary distribution Signed-off-by: Bence Csati --- .github/workflows/artifacts.yaml | 37 -------------------------------- .goreleaser.yaml | 37 -------------------------------- Makefile | 34 ++--------------------------- 3 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 .goreleaser.yaml diff --git a/.github/workflows/artifacts.yaml b/.github/workflows/artifacts.yaml index 2c74941..3cf2b93 100644 --- a/.github/workflows/artifacts.yaml +++ b/.github/workflows/artifacts.yaml @@ -81,43 +81,6 @@ jobs: name: Kube-Pod-Autocomplete Image path: image.tar - binary: - name: Binary - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: '.go-version' - - - name: Run GoReleaser ~ Build - uses: goreleaser/goreleaser-action@v6 - if : ${{ inputs.publish == false }} - with: - distribution: goreleaser - version: '~> v2' - args: release --skip=publish --snapshot - - - name: Run GoReleaser ~ Release - uses: goreleaser/goreleaser-action@v6 - if: ${{ inputs.publish == true }} - with: - distribution: goreleaser - version: '~> v2' - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload binary artifact - uses: actions/upload-artifact@v4 - with: - name: Kube-Pod-Autocomplete Binary - path: build/dist/* - helm-chart: name: Helm-Chart runs-on: ubuntu-latest diff --git a/.goreleaser.yaml b/.goreleaser.yaml deleted file mode 100644 index 902d1c7..0000000 --- a/.goreleaser.yaml +++ /dev/null @@ -1,37 +0,0 @@ -version: 2 - -project_name: kube-pod-autocomplete - -dist: build/dist - -before: - hooks: - - go mod tidy -builds: - - env: - - CGO_ENABLED=0 - ldflags: "-s -w -X main.Version={{ .Version }}" - main: . - goos: - - linux - - darwin - goarch: - - amd64 - - arm64 - -archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of uname. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - -checksum: - name_template: "checksums.txt" - -changelog: - disable: true diff --git a/Makefile b/Makefile index b56e792..a0e1610 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ build: ## Build binary go build -race -o build/kube-pod-autocomplete . .PHONY: artifacts -artifacts: container-image helm-chart binary-snapshot +artifacts: container-image helm-chart artifacts: ## Build artifacts .PHONY: container-image @@ -53,10 +53,6 @@ helm-chart: ## Build Helm chart @mkdir -p build $(HELM_BIN) package -d build/ deploy/charts/kube-pod-autocomplete -.PHONY: binary-snapshot -binary-snapshot: ## Build binary snapshot - VERSION=v${GORELEASER_VERSION} ${GORELEASER_BIN} release --clean --skip=publish --snapshot - ##@ Checks .PHONY: check @@ -91,19 +87,16 @@ fmt: ## Format code ##@ Dependencies -deps: bin/golangci-lint bin/kind bin/cosign bin/goreleaser +deps: bin/golangci-lint bin/kind deps: ## Install dependencies # Dependency versions GOLANGCI_LINT_VERSION = 1.60.3 KIND_VERSION = 0.24.0 -COSIGN_VERSION = 2.4.0 -GORELEASER_VERSION = 2.2.0 # Dependency binaries GOLANGCI_LINT_BIN := golangci-lint KIND_BIN := kind -GORELEASER_BIN := goreleaser HELM_BIN := helm bin/golangci-lint: @@ -115,29 +108,6 @@ bin/kind: curl -Lo bin/kind https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(shell uname -m | sed -e "s/aarch64/arm64/; s/x86_64/amd64/") @chmod +x bin/kind -# Goreleaser uses cosign for signing binaries -bin/cosign: - @mkdir -p bin - @OS=$$(uname -s); \ - case $$OS in \ - "Linux") \ - curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64 -o bin/cosign; \ - ;; \ - "Darwin") \ - curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-darwin-arm64 -o bin/cosign; \ - ;; \ - *) \ - echo "Unsupported OS: $$OS"; \ - exit 1; \ - ;; \ - esac - @chmod +x bin/cosign - -bin/goreleaser: - @mkdir -p bin - curl -sfL https://goreleaser.com/static/run -o bin/goreleaser - @chmod +x bin/goreleaser - bin/helm: @mkdir -p bin curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | USE_SUDO=false HELM_INSTALL_DIR=bin bash