diff --git a/Makefile b/Makefile index 4a378dbe4..0de17d717 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,10 @@ build: generate fmt vet manifests -o bin/kubectl/kubectl-hns_darwin_amd64 \ -ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \ ./cmd/kubectl/main.go + GOOS=darwin GOARCH=arm64 go build \ + -o bin/kubectl/kubectl-hns_darwin_arm64 \ + -ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \ + ./cmd/kubectl/main.go GOOS=linux GOARCH=arm64 go build \ -o bin/kubectl/kubectl-hns_linux_arm64 \ -ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \ diff --git a/cloudbuild.yaml b/cloudbuild.yaml index b2c2a7277..88ae149df 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -51,7 +51,7 @@ steps: - '-u' - '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN' - 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_linux_amd64' -# Upload plugin (Darwin) +# Upload plugin (Darwin intel) - name: gcr.io/cloud-builders/curl args: - '-X' @@ -63,6 +63,18 @@ steps: - '-u' - '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN' - 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_amd64' +# Upload plugin (Darwin arm64) +- name: gcr.io/cloud-builders/curl + args: + - '-X' + - 'POST' + - '-H' + - 'Content-Type: application/x-application' + - '--data-binary' + - '@hierarchical-namespaces/bin/kubectl/kubectl-hns_darwin_arm64' + - '-u' + - '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN' + - 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_arm64' # Upload plugin (Windows) - name: gcr.io/cloud-builders/curl args: diff --git a/hack/krew-kubectl-hns.yaml b/hack/krew-kubectl-hns.yaml index e9316a1ef..e12874541 100644 --- a/hack/krew-kubectl-hns.yaml +++ b/hack/krew-kubectl-hns.yaml @@ -58,6 +58,18 @@ spec: - from: "bin/kubectl/LICENSE" to: "." bin: "./kubectl-hns_darwin_amd64" + - uri: https://github.com/HNC_RELEASE_REPO_OWNER/hierarchical-namespaces/releases/download/HNC_IMG_TAG/kubectl-hns.tar.gz + selector: + matchLabels: + os: darwin + arch: arm64 + sha256: HNC_KREW_TAR_SHA256 + files: + - from: "bin/kubectl/kubectl-hns_darwin_arm64" + to: "." + - from: "bin/kubectl/LICENSE" + to: "." + bin: "./kubectl-hns_darwin_arm64" - uri: https://github.com/HNC_RELEASE_REPO_OWNER/hierarchical-namespaces/releases/download/HNC_IMG_TAG/kubectl-hns.tar.gz selector: matchLabels: