diff --git a/projects/kubebuilder.io/package.yml b/projects/kubebuilder.io/package.yml new file mode 100644 index 00000000..fc07bb1d --- /dev/null +++ b/projects/kubebuilder.io/package.yml @@ -0,0 +1,37 @@ +distributable: + url: https://github.com/kubernetes-sigs/kubebuilder/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: kubernetes-sigs/kubebuilder + +build: + dependencies: + go.dev: ^1.21 + gnu.org/coreutils: '*' + script: | + go build -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd + env: + CGO_ENABLED: 0 + LDFLAGS: + - -X main.kubeBuilderVersion={{version}} + - -X main.goos=$(go env GOOS) + - -X main.goarch=$(go env GOARCH) + - -X main.gitCommit=pkgx + - -X main.buildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ') + BUILDLOC: '{{prefix}}/bin/kubebuilder' + +provides: + - bin/kubebuilder + +test: + dependencies: + gnu.org/grep: '*' + go.dev: ^1.21 + script: | + kubebuilder version | grep 'KubeBuilderVersion:"{{version}}"' + mkdir test + cd test + go mod init example.com + kubebuilder init --plugins go/v4 --project-version 3 --skip-go-version-check + go clean --modcache