Merge pull request #111 from leonnicolas/release_binaries
.github/workflows/ci.yml: publish binaries
This commit is contained in:
commit
0eaefc5e6e
21
.github/workflows/release.yaml
vendored
Normal file
21
.github/workflows/release.yaml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
name: Handle Release
|
||||||
|
jobs:
|
||||||
|
linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.7
|
||||||
|
- name: Make Directory with kgctl Binaries to Be Released
|
||||||
|
run: make release
|
||||||
|
- name: Publish Release
|
||||||
|
uses: skx/github-action-publish-binaries@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
args: 'bin/release/kgctl-*'
|
10
Makefile
10
Makefile
@ -1,5 +1,5 @@
|
|||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
.PHONY: push container clean container-name container-latest push-latest fmt lint test unit vendor header generate client deepcopy informer lister openapi manifest manfest-latest manifest-annotate manifest manfest-latest manifest-annotate
|
.PHONY: push container clean container-name container-latest push-latest fmt lint test unit vendor header generate client deepcopy informer lister openapi manifest manfest-latest manifest-annotate manifest manfest-latest manifest-annotate release
|
||||||
|
|
||||||
OS ?= $(shell go env GOOS)
|
OS ?= $(shell go env GOOS)
|
||||||
ARCH ?= $(shell go env GOARCH)
|
ARCH ?= $(shell go env GOARCH)
|
||||||
@ -11,6 +11,8 @@ ifeq ($(OS),linux)
|
|||||||
else
|
else
|
||||||
BINS := bin/$(OS)/$(ARCH)/kgctl
|
BINS := bin/$(OS)/$(ARCH)/kgctl
|
||||||
endif
|
endif
|
||||||
|
RELEASE_BINS := $(addprefix bin/release/kgctl-, $(addprefix linux-, $(ALL_ARCH)) darwin-amd64 windows-amd64)
|
||||||
|
CLIENT_BINS := $(addsuffix /kgctl, $(addprefix bin/, $(addprefix linux/, $(ALL_ARCH)) darwin/amd64 windows/amd64))
|
||||||
PROJECT := kilo
|
PROJECT := kilo
|
||||||
PKG := github.com/squat/$(PROJECT)
|
PKG := github.com/squat/$(PROJECT)
|
||||||
REGISTRY ?= index.docker.io
|
REGISTRY ?= index.docker.io
|
||||||
@ -295,6 +297,12 @@ push-latest: container-latest
|
|||||||
push-name:
|
push-name:
|
||||||
@echo "pushed: $(IMAGE):$(ARCH)-$(VERSION)"
|
@echo "pushed: $(IMAGE):$(ARCH)-$(VERSION)"
|
||||||
|
|
||||||
|
release: $(RELEASE_BINS)
|
||||||
|
$(RELEASE_BINS):
|
||||||
|
@make OS=$(word 2,$(subst -, ,$(@F))) ARCH=$(word 3,$(subst -, ,$(@F)))
|
||||||
|
mkdir -p $(@D)
|
||||||
|
cp bin/$(word 2,$(subst -, ,$(@F)))/$(word 3,$(subst -, ,$(@F)))/kgctl $@
|
||||||
|
|
||||||
clean: container-clean bin-clean
|
clean: container-clean bin-clean
|
||||||
rm -rf .cache
|
rm -rf .cache
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user