Skip to content

Commit 08de2f6

Browse files
authored
Create go.yml
1 parent 1bf3c77 commit 08de2f6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/go.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
goos: [linux, windows, darwin] # 需要打包的系统
17+
goarch: [amd64, arm64] # 需要打包的架构
18+
exclude: # 排除某些平台和架构
19+
- goarch: arm64
20+
goos: windows
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Go
25+
uses: wangyoucao577/go-release-action@v1.30
26+
with:
27+
go-version: '1.21'
28+
github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
29+
goos: ${{ matrix.goos }}
30+
goarch: ${{ matrix.goarch }}
31+
binary_name: leetcode-tool # 可以指定二进制文件的名称
32+

0 commit comments

Comments
 (0)