Skip to content

Commit

Permalink
Apple M1 build
Browse files Browse the repository at this point in the history
  • Loading branch information
simonoff committed Dec 1, 2021
1 parent a4fe5ce commit afe9582
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down
14 changes: 13 additions & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions hack/krew-kubectl-hns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit afe9582

Please sign in to comment.