diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..e1e58206d --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/Makefile b/Makefile index efcea2634..11415f7f7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ GOOS ?= $(shell go env GOOS) +GOARCH ?= $(shell go env GOARCH) SOURCES := $(shell find . -type f -name '*.go') # Git information