diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13a8131..8201c20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,12 +40,19 @@ jobs: GOARCH: amd64 run: make - - name: Build (linux/arm) + - name: Build (linux/arm64) env: GOOS: linux GOARCH: arm64 run: make + - name: Build (linux/armv7) + env: + GOOS: linux + GOARCH: arm + GOARM: "7" + run: make + - name: Build (darwin) env: GOOS: darwin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56a7a8c..d0f0b68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,12 +56,19 @@ jobs: GOARCH: amd64 run: make - - name: Build (linux/arm) + - name: Build (linux/arm64) env: GOOS: linux GOARCH: arm64 run: make + - name: Build (linux/armv7) + env: + GOOS: linux + GOARCH: arm + GOARM: "7" + run: make + - name: Build (darwin) env: GOOS: darwin @@ -125,6 +132,11 @@ jobs: with: args: zip -qq kubelogin-linux-arm64.zip bin/linux_arm64/kubelogin + - name: Zip (linux-armv7) + uses: montudor/action-zip@v1 + with: + args: zip -qq kubelogin-linux-armv7.zip bin/linux_armv7/kubelogin + - name: Create sha256 Checksums run: | sha256sum kubelogin.zip > kubelogin.zip.sha256 @@ -134,13 +146,14 @@ jobs: sha256sum kubelogin-darwin-arm64.zip > kubelogin-darwin-arm64.zip.sha256 sha256sum kubelogin-linux-amd64.zip > kubelogin-linux-amd64.zip.sha256 sha256sum kubelogin-linux-arm64.zip > kubelogin-linux-arm64.zip.sha256 + sha256sum kubelogin-linux-armv7.zip > kubelogin-linux-armv7.zip.sha256 - name: Publish uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: kubelogin.zip kubelogin-win-amd64.zip kubelogin-win-arm64.zip kubelogin-darwin-amd64.zip kubelogin-darwin-arm64.zip kubelogin-linux-amd64.zip kubelogin-linux-arm64.zip kubelogin.zip.sha256 kubelogin-win-amd64.zip.sha256 kubelogin-win-arm64.zip.sha256 kubelogin-darwin-amd64.zip.sha256 kubelogin-darwin-arm64.zip.sha256 kubelogin-linux-amd64.zip.sha256 kubelogin-linux-arm64.zip.sha256 + args: kubelogin.zip kubelogin-win-amd64.zip kubelogin-win-arm64.zip kubelogin-darwin-amd64.zip kubelogin-darwin-arm64.zip kubelogin-linux-amd64.zip kubelogin-linux-arm64.zip kubelogin-linux-armv7.zip kubelogin.zip.sha256 kubelogin-win-amd64.zip.sha256 kubelogin-win-arm64.zip.sha256 kubelogin-darwin-amd64.zip.sha256 kubelogin-darwin-arm64.zip.sha256 kubelogin-linux-amd64.zip.sha256 kubelogin-linux-arm64.zip.sha256 kubelogin-linux-armv7.zip.sha256 releaseId: ${{ steps.create_release.outputs.id }} - name: Publish to Snap Store diff --git a/Makefile b/Makefile index fbc3168..6b545d9 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,17 @@ TARGET := kubelogin OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BIN = bin/$(OS)_$(ARCH)/$(TARGET) +GOARM := $(if $(GOARM),$(GOARM),) +BIN = bin/$(OS)_$(ARCH)$(if $(GOARM),v$(GOARM),)/$(TARGET) ifeq ($(OS),windows) - BIN = bin/$(OS)_$(ARCH)/$(TARGET).exe + BIN = bin/$(OS)_$(ARCH)$(if $(GOARM),v$(GOARM),)/$(TARGET).exe endif GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) GIT_HASH := $(shell git rev-parse --verify HEAD) GIT_TAG := $(shell git describe --tags --exact-match --abbrev=0 2>/dev/null || echo "") BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") -PLATFORM := $(OS)/$(ARCH) +PLATFORM := $(OS)/$(ARCH)$(if $(GOARM),v$(GOARM),) ifdef GIT_TAG VERSION := $(GIT_TAG)/$(GIT_HASH)