From e867f9ef6b11f67efe4fd9fd00e637411e067d0e Mon Sep 17 00:00:00 2001 From: wuyingjun Date: Tue, 19 Sep 2023 11:30:39 +0800 Subject: [PATCH] add github release action Signed-off-by: wuyingjun --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..049640223 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +## Workflow's name +#name: release kosmosctl for linux&darwin +# +## Workflow's trigger +on: + push: + tags: + - "v*.*.*" + +# Workflow's jobs +jobs: + # job's id + release: + # job's name + name: release kosmosctl for linux&darwin + + # allow to upload release binary + permissions: write-all + + # the type of machine to run the job on + runs-on: ubuntu-20.04 + + # create steps + steps: + # step1: check out repository + - name: Check out git repository + uses: actions/checkout@v3 + + # step2: install go env + - name: Install Go + uses: actions/setup-go@v3 + + # step3: make binaries + - name: Make binaries + run: make release + + # step4: create release + - name: release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + _output/release/kosmosctl-linux-amd64 + _output/release/kosmosctl-linux-arm64 + _output/release/kosmosctl-darwin-amd64 + _output/release/kosmosctl-darwin-arm64 +