Skip to content

Commit

Permalink
feat(release): add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
joyme123 committed Mar 10, 2021
1 parent 0e1758c commit 8ef45f4
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,29 @@ jobs:
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: kubecm
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
build/kubecm*
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Test
run: go test -v ./...

- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: kubecm
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
build/kubecm*

0 comments on commit 8ef45f4

Please sign in to comment.