Skip to content

Commit

Permalink
add github release action
Browse files Browse the repository at this point in the history
Signed-off-by: wuyingjun <[email protected]>
  • Loading branch information
wuyingjun-lucky committed Sep 19, 2023
1 parent a8366fb commit 1098b99
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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

# the type of machine to run the job on
runs-on: ubuntu-20.04

# create a build matrix for jobs
strategy:
fail-fast: false
matrix:
target: kosmosctl
os: [linux, darwin]
arch: [amd64, arm64]

# 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-${{ matrix.os }}-${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1098b99

Please sign in to comment.