-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (33 loc) · 1003 Bytes
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build Release
on:
push:
# Pattern matched against refs/tags
tags:
- 'v*' # 创建所有tag都运行打包 v* 则 v1.0这种也行
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ">=1.20"
cache: true
- name: Check golang version
run: go version
# 使用 goreleaser 进行生成多平台代码并且上传到github release进行发布
- name: Create release on GitHub
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: 'latest'
args: 'release --clean'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}