Skip to content

Commit

Permalink
Add release binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Jul 25, 2023
1 parent 796fc0f commit 351ba9b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ jobs:
_output/components.yaml
_output/high-availability.yaml
_output/high-availability-1.21+.yaml
- name: Build binaries
run: make release-binaries
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
_output/metrics-server-*
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ BUILD_DATE:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
ALL_ARCHITECTURES=amd64 arm arm64 ppc64le s390x
export DOCKER_CLI_EXPERIMENTAL=enabled

BINARIES_ARCHITECTURES=amd64 arm64
BINARIES_PLATFORMS=linux darwin windows

# Tools versions
# --------------
GOLANGCI_VERSION:=1.53.2
Expand Down Expand Up @@ -95,6 +98,19 @@ release-manifests:
kubectl kustomize manifests/overlays/release-ha > _output/high-availability.yaml
kubectl kustomize manifests/overlays/release-ha-1.21+ > _output/high-availability-1.21+.yaml

.PHONY: release-binaries
release-binaries:
@mkdir -p _output
@for arch in $(BINARIES_ARCHITECTURES); do \
for platform in $(BINARIES_PLATFORMS); do \
binary_name=metrics-server-$${platform}-$${arch}; \
if [ "$${platform}" = "windows" ]; then \
binary_name=$${binary_name}.exe; \
fi; \
GOARCH=$${arch} GOOS=$${platform} CGO_ENABLED=0 \
go build -mod=readonly -ldflags "$(LDFLAGS)" -o $(REPO_DIR)/_output/$${binary_name} sigs.k8s.io/metrics-server/cmd/metrics-server; \
done; \
done

# fuzz tests
# ----------
Expand Down

0 comments on commit 351ba9b

Please sign in to comment.