added: github actions for building binaries (#738)

* added: github actions, for #735

Signed-off-by: Vincent Cui <dustise@live.com>

* Add LICENSE to the package.

Signed-off-by: Vincent Cui <dustise@live.com>

* add support for act

Signed-off-by: Vincent Cui <dustise@live.com>

* following the comments.

Signed-off-by: Vincent Cui <dustise@live.com>

* replace old images

Signed-off-by: Vincent Cui <dustise@live.com>
This commit is contained in:
Vincent 2021-09-23 09:25:27 +08:00 committed by GitHub
parent badccfcc82
commit ebcd58473c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

38
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,38 @@
on:
release:
types:
- created
name: Build Release
jobs:
release-assests:
name: release kubectl-karmada
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- goarch: amd64
goos: linux
- goarch: amd64
goos: darwin
- goarch: arm64
goos: linux
- goarch: arm64
goos: darwin
steps:
- uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Making kubectl-karmada
run: make kubectl-karmada
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
- name: Packaging...
run: tar czf kubectl-karmada-${{ matrix.goos }}-${{ matrix.goarch }}.tgz kubectl-karmada LICENSE
- name: Uploading assets...
if: ${{ !env.ACT }}
uses: softprops/action-gh-release@v1
with:
files: ./kubectl-karmada-${{ matrix.goos }}-${{ matrix.goarch }}.tgz

View File

@ -1,4 +1,5 @@
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
SOURCES := $(shell find . -type f -name '*.go')
# Git information