-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (41 loc) · 1.3 KB
/
Copy pathrelease.yml
File metadata and controls
49 lines (41 loc) · 1.3 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
47
48
49
name: goreleaser
on:
push:
# 只有推送 v 开头的 tag 时才触发发布流程
tags:
- 'v*'
permissions:
contents: write # 必须赋予写入权限,以便 Action 能够创建 Release
# 【新增】全局环境变量:强制所有基于 JS 的 Action 使用 Node 24,消除过时警告
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取所有历史记录和 tag
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod' # 💡 修复点 1:让 Action 自动跟随项目真实的 Go 版本
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build web dist
working-directory: web
run: |
npm ci
npm run build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 💡 修复点 2:补回本仓库的内置鉴权令牌
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}