Refactor release workflow and update actions

Updated GitHub Actions workflow to remove container configuration and use the latest versions of actions.
This commit is contained in:
乔焰阳
2025-11-06 15:58:28 +08:00
committed by GitHub
parent e856543529
commit 69b4380e38

View File

@@ -17,15 +17,16 @@ jobs:
# runs-on指定了运行作业的虚拟机环境类型
# 即使使用containerruns-on仍然是必要的配置
runs-on: ubuntu-latest
# 在runner上运行golang容器
container:
# 使用最新版本的golang镜像无需指定具体版本号
image: golang:latest-alpine
# 移除容器配置以避免Docker Hub拉取超时问题
# 直接在GitHub托管的runner环境中执行任务
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4 # 使用最新稳定的v4版本
# Go environment is already provided by the container image
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable' # 使用最新稳定版本的Go无需手动更新版本号
- name: Install gf CLI
run: |
@@ -42,7 +43,8 @@ jobs:
run: gf build -ew -v "${{ github.ref_name }}"
- name: Upload build artifacts
uses: actions/upload-artifact@v3
# 使用main分支以获取最新版本的action无需手动更新版本号
uses: actions/upload-artifact@main
with:
name: p2p-${{ github.ref_name }}
path: |
@@ -53,16 +55,15 @@ jobs:
# runs-on指定了运行作业的虚拟机环境类型
# 即使使用containerruns-on仍然是必要的配置
runs-on: ubuntu-latest
# 在runner上运行golang容器
container:
# 使用最新版本的golang镜像无需指定具体版本号
image: golang:latest-alpine
# 移除容器配置以避免Docker Hub拉取超时问题
# 直接在GitHub托管的runner环境中执行任务
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
# 使用main分支以获取最新版本的action无需手动更新版本号
uses: actions/download-artifact@main
with:
name: p2p-${{ github.ref_name }}
path: bin
@@ -93,7 +94,7 @@ jobs:
ls -al dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2 # 更新到最新稳定的v2版本
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}