Skip to content

Commit 35698b0

Browse files
committed
fix: 修复GitHub Actions废弃版本导致workflow失败
- actions/cache@v4.0.0 → v4 (已废弃,导致所有workflow失败) - actions/checkout@v4.1.1 → v4 - actions/setup-go@v5.0.0 → v5 - actions/upload-artifact@v4.3.1 → v4 - crazy-max/ghaction-upx@v3.0.0 → v3 - goreleaser/goreleaser-action@v5.0.0 → v6 (升级到最新版本) 使用主版本号可自动获取最新patch,避免固定版本被废弃问题
1 parent 86490f3 commit 35698b0

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: 📥 检出代码
39-
uses: actions/checkout@v4.1.1
39+
uses: actions/checkout@v4
4040
with:
4141
fetch-depth: 0
4242
token: ${{ secrets.GITHUB_TOKEN }}
@@ -58,13 +58,13 @@ jobs:
5858
echo "build_timestamp=$(date +%s)" >> $GITHUB_OUTPUT
5959
6060
- name: 🐹 设置 Go 环境
61-
uses: actions/setup-go@v5.0.0
61+
uses: actions/setup-go@v5
6262
with:
6363
go-version: '1.20'
6464
cache: true
6565

6666
- name: 💾 缓存Go模块
67-
uses: actions/cache@v4.0.0
67+
uses: actions/cache@v4
6868
with:
6969
path: |
7070
~/.cache/go-build
@@ -79,7 +79,7 @@ jobs:
7979
go mod verify
8080
8181
- name: 🗜️ 安装 UPX 压缩工具
82-
uses: crazy-max/ghaction-upx@v3.0.0
82+
uses: crazy-max/ghaction-upx@v3
8383
with:
8484
install-only: true
8585

@@ -105,7 +105,7 @@ jobs:
105105
106106
- name: 🚀 构建和发布
107107
id: build_step
108-
uses: goreleaser/goreleaser-action@v5.0.0
108+
uses: goreleaser/goreleaser-action@v6
109109
with:
110110
distribution: goreleaser
111111
version: latest
@@ -130,7 +130,7 @@ jobs:
130130
echo "duration_readable=$(printf '%02d:%02d:%02d' $((duration/3600)) $((duration%3600/60)) $((duration%60)))" >> $GITHUB_OUTPUT
131131
132132
- name: 📋 上传构建产物
133-
uses: actions/upload-artifact@v4.3.1
133+
uses: actions/upload-artifact@v4
134134
if: always()
135135
with:
136136
name: 发布产物-${{ steps.project.outputs.version }}

.github/workflows/test-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
steps:
5757
- name: 📥 检出代码
58-
uses: actions/checkout@v4.1.1
58+
uses: actions/checkout@v4
5959
with:
6060
fetch-depth: 0
6161
ref: ${{ github.event.inputs.branch || github.ref }}
@@ -72,13 +72,13 @@ jobs:
7272
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
7373
7474
- name: 🐹 设置 Go 环境
75-
uses: actions/setup-go@v5.0.0
75+
uses: actions/setup-go@v5
7676
with:
7777
go-version: '1.20'
7878
cache: true
7979

8080
- name: 💾 缓存Go模块
81-
uses: actions/cache@v4.0.0
81+
uses: actions/cache@v4
8282
with:
8383
path: |
8484
~/.cache/go-build
@@ -93,7 +93,7 @@ jobs:
9393
go mod verify
9494
9595
- name: 🗜️ 安装 UPX 压缩工具
96-
uses: crazy-max/ghaction-upx@v3.0.0
96+
uses: crazy-max/ghaction-upx@v3
9797
with:
9898
install-only: true
9999

@@ -117,7 +117,7 @@ jobs:
117117
echo "start_readable=$(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> $GITHUB_OUTPUT
118118
119119
- name: 🚀 测试构建 (Snapshot 模式)
120-
uses: goreleaser/goreleaser-action@v5.0.0
120+
uses: goreleaser/goreleaser-action@v6
121121
with:
122122
distribution: goreleaser
123123
version: latest
@@ -138,7 +138,7 @@ jobs:
138138
echo "duration_readable=$(printf '%02d:%02d:%02d' $((duration/3600)) $((duration%3600/60)) $((duration%60)))" >> $GITHUB_OUTPUT
139139
140140
- name: 📋 上传测试产物
141-
uses: actions/upload-artifact@v4.3.1
141+
uses: actions/upload-artifact@v4
142142
with:
143143
name: 测试构建-${{ steps.project.outputs.branch }}-${{ steps.project.outputs.short_sha }}
144144
path: |

0 commit comments

Comments
 (0)