Skip to content

Commit

Permalink
Merge pull request #5 from csatib02/refactor/remove-binary-distribution
Browse files Browse the repository at this point in the history
refactor(build): remove binary distribution
  • Loading branch information
csatib02 authored Sep 3, 2024
2 parents b4cd037 + 94ed52b commit f18e167
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 106 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 0 additions & 37 deletions .goreleaser.yaml

This file was deleted.

34 changes: 2 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit f18e167

Please sign in to comment.