Skip to content

Commit

Permalink
fixing more issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mjudeikis committed Nov 26, 2024
1 parent 892d620 commit c705f6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 58 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ jobs:

# Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
# Tags the image as 'latest' only for master branch, versioned tags for versioned pushes, and PR-specific tags
# Tags the image based on branch, PR, or release
tags: |
# Version tags for releases
${{ steps.meta.outputs.tags }}
# Latest tag for master branch only
${{ github.ref == 'refs/heads/master' && env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
# Commit SHA for PR builds for more precise versioning
${{ github.event_name == 'pull_request' && env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ github.ref == 'refs/heads/master' && env.REGISTRY && env.IMAGE_NAME && format('{0}/{1}:latest', env.REGISTRY, env.IMAGE_NAME) }}
labels: ${{ steps.meta.outputs.labels }}
# Commit SHA for PR builds for precise versioning
${{ github.event_name == 'pull_request' && env.REGISTRY && env.IMAGE_NAME && format('{0}/{1}:{2}', env.REGISTRY, env.IMAGE_NAME, github.sha) }}
labels: ${{ steps.meta.outputs.labels }}
52 changes: 2 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ SRC := $(shell find . -type f -name '*.go')
GO_FILES ?= $$(find . -name '*.go')
GO_PKGS ?= $$(go list ./...)

CONTROLLER_GEN_BINARY := bin/controller-gen
CLIENT_GEN_BINARY := bin/client-gen
DOCS_GEN_BINARY := bin/docs-gen
DEEPCOPY_GEN_BINARY := bin/deepcopy-gen
INFORMER_GEN_BINARY := bin/informer-gen
LISTER_GEN_BINARY := bin/lister-gen
STATICCHECK_BINARY := bin/staticcheck
DOCS_GEN_BINARY := bin/docs-gen
EMBEDMD_BINARY := bin/embedmd
KIND_BINARY := $(shell pwd)/bin/kind
KUBECTL_BINARY := $(shell pwd)/bin/kubectl
Expand Down Expand Up @@ -120,31 +115,6 @@ goreleaser:
ldflags:
@echo $(LDFLAGS)

build-%:
@$(MAKE) --no-print-directory OS=$(word 1,$(subst -, ,$*)) ARCH=$(word 2,$(subst -, ,$*)) build

container-latest-%:
@$(MAKE) --no-print-directory ARCH=$* container-latest

container-%:
@$(MAKE) --no-print-directory ARCH=$* container

push-latest-%:
@$(MAKE) --no-print-directory ARCH=$* push-latest

push-%:
@$(MAKE) --no-print-directory ARCH=$* push

all-build: $(addprefix build-$(OS)-, $(ALL_ARCH))

all-container: $(addprefix container-, $(ALL_ARCH))

all-push: $(addprefix push-, $(ALL_ARCH))

all-container-latest: $(addprefix container-latest-, $(ALL_ARCH))

all-push-latest: $(addprefix push-latest-, $(ALL_ARCH))

generate: codegen crds

fmt:
Expand Down Expand Up @@ -224,33 +194,15 @@ website/build/index.html: website/docs/README.md docs/api.md
container:
docker build -t $(FULLY_QUALIFIED_IMAGE):latest -f Dockerfile .

clean: container-clean bin-clean
clean: bin-clean
rm -rf .cache

container-clean:
rm -rf .container-* .manifest-* .push-*

bin-clean:
rm -rf bin

gomodtidy:
go mod tidy

$(CONTROLLER_GEN_BINARY):
go build -o $@ sigs.k8s.io/controller-tools/cmd/controller-gen

$(CLIENT_GEN_BINARY):
go build -o $@ k8s.io/code-generator/cmd/client-gen

$(DEEPCOPY_GEN_BINARY):
go build -o $@ k8s.io/code-generator/cmd/deepcopy-gen

$(INFORMER_GEN_BINARY):
go build -o $@ k8s.io/code-generator/cmd/informer-gen

$(LISTER_GEN_BINARY):
go build -o $@ k8s.io/code-generator/cmd/lister-gen

$(DOCS_GEN_BINARY): cmd/docs-gen/main.go
go build -o $@ ./cmd/docs-gen

Expand Down

0 comments on commit c705f6b

Please sign in to comment.