From c26d5eacc0298314da4c1571a8d147a157c940a5 Mon Sep 17 00:00:00 2001 From: LiZhenCheng9527 Date: Thu, 10 Oct 2024 11:53:15 +0800 Subject: [PATCH] auto release test Signed-off-by: LiZhenCheng9527 --- .github/workflows/release.yml | 56 ++++++++++++++++++++++++++++++++--- Makefile | 9 +++++- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe0195f1f..23c8b45b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,58 @@ on: types: - published name: Build Release -permission: +permissions: contents: read jobs: - release-assests: - permission: + kmeshctl-assets: + permissions: contents: write # for softprops/action-gh-release to create GitHub release - \ No newline at end of file + name: release kmeshctl + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + target: + - kmeshctl + os: + - linux + arch: + - amd64 + - arm64 + steps: + - uses: actions/checkout@v4 + + - name: Setup go + uses: actions/setup-go@v4.0.0 + with: + go-version-file: go.mod + + - name: Making and packaging + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + run: make build-kmeshctl OUT=kmeshctl-${{ matrix.os }}-${{ matrix.arch }} + - name: Uploading kmeshctl assets + if: ${{ !env.ACT }} + uses: softprops/action-gh-release@v2 + with: + files: | + kmeshctl-${{ matrix.os }}-${{ matrix.arch }} + + kmesh-helm: + permissions: + contents: write # for softprops/action-gh-release to create GitHub release + name: Release helm + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Making helm package + env: + VERSION: ${{ github.ref_name }} + run: make helm-package CHART_VERSION=${{ github.ref_name }} + - name: Uploading kmesh helm package + if: ${{ !env.ACT }} + uses: softprops/action-gh-release@v2 + with: + files: | + out/charts/kmesh-helm-${{ github.ref_name }}.tgz diff --git a/Makefile b/Makefile index 2ee80076b..ce42e6afc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright 2023 The Kmesh Authors. +# Copyright The Kmesh Authors. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -100,6 +100,13 @@ all: $(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \ $(GO) build -ldflags $(LDFLAGS) -o $(APPS4) $(GOFLAGS) ./ctl/main.go) +OUT ?= kmeshctl +.PHONY: build-kmeshctl +build-kmeshctl: + $(call printlog, BUILD, $(APPS4)) + $(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \ + $(GO) build -o $(OUT) $(GOFLAGS) ./ctl/main.go) + .PHONY: gen-proto gen-proto: $(QUIET) make -C api gen-proto