-
Notifications
You must be signed in to change notification settings - Fork 9
46 lines (41 loc) · 1.03 KB
/
release.yml
File metadata and controls
46 lines (41 loc) · 1.03 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
name: release
# 触发条件:推一个 vX.Y.Z 形式的 tag。
#
# 标准发布流程:
# git tag v0.1.0
# git push origin v0.1.0
#
# 推完 tag 后,本 workflow 自动:
# 1. checkout
# 2. 装 Go 1.25
# 3. 跑 goreleaser:5 平台 cross-compile + 打 tar.gz/zip + 生成 changelog + 发 GitHub Release
#
# 不需要任何额外 secret,GITHUB_TOKEN 由 Actions 自动注入。
on:
push:
tags:
- "v*"
permissions:
contents: write # 发 Release 需要
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# goreleaser 算 changelog 需要完整 git 历史
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}