diff --git a/.cursor/rules/zz_generated.base-llm-rules.mdc b/.cursor/rules/zz_generated.base-llm-rules.mdc index cc3049361..784ea24c7 100644 --- a/.cursor/rules/zz_generated.base-llm-rules.mdc +++ b/.cursor/rules/zz_generated.base-llm-rules.mdc @@ -56,6 +56,6 @@ For detailed guidelines and examples, always refer to: @https://github.com/giant diff --git a/.cursor/rules/zz_generated.go-llm-rules.mdc b/.cursor/rules/zz_generated.go-llm-rules.mdc index cc3284166..477ab3e19 100644 --- a/.cursor/rules/zz_generated.go-llm-rules.mdc +++ b/.cursor/rules/zz_generated.go-llm-rules.mdc @@ -30,6 +30,6 @@ When creating or modifying Go files, perform the according check and mitigate an diff --git a/.github/workflows/zz_generated.check_values_schema.yaml b/.github/workflows/zz_generated.check_values_schema.yaml index 3785bd334..426a4b62d 100644 --- a/.github/workflows/zz_generated.check_values_schema.yaml +++ b/.github/workflows/zz_generated.check_values_schema.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/check_values_schema.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/check_values_schema.yaml.template # name: 'Values and schema' diff --git a/.github/workflows/zz_generated.create_release.yaml b/.github/workflows/zz_generated.create_release.yaml index 60ddf39dd..8b3d857b8 100644 --- a/.github/workflows/zz_generated.create_release.yaml +++ b/.github/workflows/zz_generated.create_release.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/0df8c5e633bb1e4fd17c35525a7b382395526f22/pkg/gen/input/workflows/internal/file/create_release.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/create_release.yaml.template # name: Create Release diff --git a/.github/workflows/zz_generated.create_release_pr.yaml b/.github/workflows/zz_generated.create_release_pr.yaml index 1a19e88da..fe8a5fa92 100644 --- a/.github/workflows/zz_generated.create_release_pr.yaml +++ b/.github/workflows/zz_generated.create_release_pr.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template # name: Create Release PR on: diff --git a/.github/workflows/zz_generated.fix_vulnerabilities.yaml b/.github/workflows/zz_generated.fix_vulnerabilities.yaml index 05fb25cc9..e8a992b31 100644 --- a/.github/workflows/zz_generated.fix_vulnerabilities.yaml +++ b/.github/workflows/zz_generated.fix_vulnerabilities.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/6ff4d7652142f59436c1d1ef925f8d687e1ac671/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template # name: Fix Go vulnerabilities @@ -14,11 +14,12 @@ on: inputs: branch: description: Branch on which to fix vulnerabilities + default: main required: true type: string log_level: description: Log Level (info / error / debug) - default: "info" + default: info type: string permissions: {} diff --git a/.github/workflows/zz_generated.gitleaks.yaml b/.github/workflows/zz_generated.gitleaks.yaml index b1e772e3b..2712ee1ba 100644 --- a/.github/workflows/zz_generated.gitleaks.yaml +++ b/.github/workflows/zz_generated.gitleaks.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template # name: gitleaks diff --git a/.github/workflows/zz_generated.run_ossf_scorecard.yaml b/.github/workflows/zz_generated.run_ossf_scorecard.yaml index 317cc41f5..8d580bc93 100644 --- a/.github/workflows/zz_generated.run_ossf_scorecard.yaml +++ b/.github/workflows/zz_generated.run_ossf_scorecard.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/4897b6ea0f98cfba54f8d3003f5bdcefb968a7b5/pkg/gen/input/workflows/internal/file/run_ossf_scorecard.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/run_ossf_scorecard.yaml.template # # This workflow uses actions that are not certified by GitHub. They are provided diff --git a/.github/workflows/zz_generated.validate_changelog.yaml b/.github/workflows/zz_generated.validate_changelog.yaml index 108bbc06c..26d8591f0 100644 --- a/.github/workflows/zz_generated.validate_changelog.yaml +++ b/.github/workflows/zz_generated.validate_changelog.yaml @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/validate_changelog.yaml.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/workflows/internal/file/validate_changelog.yaml.template # name: Validate changelog diff --git a/Makefile b/Makefile index 76d53dae6..14ffae51f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/6a704f7e2a8b0f09e82b5bab88f17971af849711/pkg/gen/input/makefile/internal/file/Makefile.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/makefile/internal/file/Makefile.template # include Makefile.*.mk diff --git a/Makefile.gen.app.mk b/Makefile.gen.app.mk index 3f8a89c95..c72aae09c 100644 --- a/Makefile.gen.app.mk +++ b/Makefile.gen.app.mk @@ -2,7 +2,7 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/eea19f200d7cfd27ded22474b787563bbfdb8ec4/pkg/gen/input/makefile/internal/file/Makefile.gen.app.mk.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/makefile/internal/file/Makefile.gen.app.mk.template # ##@ App diff --git a/Makefile.gen.go.mk b/Makefile.gen.go.mk index a186ca713..8c3140147 100644 --- a/Makefile.gen.go.mk +++ b/Makefile.gen.go.mk @@ -2,13 +2,15 @@ # # devctl # -# https://github.com/giantswarm/devctl/blob/bf7f386ac6a4e807dde959892df1369fee6d789f/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template +# https://github.com/giantswarm/devctl/blob/c2dd604fd787d9aa63ec6c43c817c8596f1356f7/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template # APPLICATION := $(shell go list -m | cut -d '/' -f 3) BUILDTIMESTAMP := $(shell date -u '+%FT%TZ') GITSHA1 := $(shell git rev-parse --verify HEAD) MODULE := $(shell go list -m) +# main() is usually in `main.go`, but sometimes in `cmd/main.go` (for example in newer kubebuilder projects) +MAIN_SOURCE := $(shell if test -e cmd/main.go; then echo cmd/main.go; else echo main.go; fi) OS := $(shell go env GOOS) SOURCES := $(shell find . -name '*.go') VERSION := $(shell architect project version) @@ -63,25 +65,25 @@ $(APPLICATION)-windows-amd64.exe: $(APPLICATION)-v$(VERSION)-windows-amd64.exe $(APPLICATION)-v$(VERSION)-%-amd64: $(SOURCES) @echo "====> $@" - CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ . + CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)" $(APPLICATION)-v$(VERSION)-%-arm64: $(SOURCES) @echo "====> $@" - CGO_ENABLED=0 GOOS=$* GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ . + CGO_ENABLED=0 GOOS=$* GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)" $(APPLICATION)-v$(VERSION)-windows-amd64.exe: $(SOURCES) @echo "====> $@" - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ . + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)" .PHONY: install install: ## Install the application. @echo "====> $@" - go install -ldflags "$(LDFLAGS)" . + go build -ldflags "$(LDFLAGS)" -o "$(shell go env GOPATH)/bin/$(APPLICATION)" "$(MAIN_SOURCE)" .PHONY: run run: ## Runs go run main.go. @echo "====> $@" - go run -ldflags "$(LDFLAGS)" -race . + go run -ldflags "$(LDFLAGS)" -race "$(MAIN_SOURCE)" .PHONY: clean clean: ## Cleans the binary.