Skip to content

Commit bd46df1

Browse files
committed
Add GitHub workflow
1 parent fd60a94 commit bd46df1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
create_release:
10+
name: Create release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Read info
18+
id: tags
19+
shell: bash
20+
run: |
21+
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
22+
- name: Create Release
23+
id: create_release
24+
uses: actions/create-release@master
25+
env:
26+
GITHUB_TOKEN: ${{ github.token }}
27+
with:
28+
tag_name: ${{ steps.tags.outputs.tag }}
29+
release_name: ${{ steps.tags.outputs.tag }}
30+
draft: false
31+
prerelease: false
32+
publish_binaries:
33+
name: Release Go Binary
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
goos: [linux, windows, darwin]
38+
goarch: [amd64, arm64]
39+
exclude:
40+
- goarch: arm64
41+
goos: windows
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v3
45+
- name: Read info
46+
id: tags
47+
shell: bash
48+
run: |
49+
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
50+
- name: Build and Publish
51+
uses: wangyoucao577/go-release-action@v1.28
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
goos: ${{ matrix.goos }}
55+
goarch: ${{ matrix.goarch }}
56+
asset_name: cg-debug-${{matrix.goos}}-${{matrix.goarch}}
57+
extra_files: LICENSE README.md
58+
release_tag: ${{ steps.tags.outputs.tag }}

0 commit comments

Comments
 (0)