4 Commits

Author SHA1 Message Date
乔焰阳
680d36e526 Simplify artifact handling in release workflow
Removed Gitea-specific artifact upload and download steps, simplifying the workflow.
2025-11-06 17:50:20 +08:00
乔焰阳
0a5432406a Refactor GitHub Actions workflow for releases
Updated GitHub Actions workflow to remove caching for Go installation and GF CLI, and adjusted artifact upload and download steps for GitHub and Gitea.
2025-11-06 17:20:34 +08:00
乔焰阳
7b16777411 Enhance release workflow with caching steps
Added caching for Go installation and GF CLI in the release workflow.
2025-11-06 16:03:04 +08:00
乔焰阳
69b4380e38 Refactor release workflow and update actions
Updated GitHub Actions workflow to remove container configuration and use the latest versions of actions.
2025-11-06 15:58:28 +08:00

View File

@@ -17,18 +17,21 @@ jobs:
# runs-on指定了运行作业的虚拟机环境类型 # runs-on指定了运行作业的虚拟机环境类型
# 即使使用containerruns-on仍然是必要的配置 # 即使使用containerruns-on仍然是必要的配置
runs-on: ubuntu-latest runs-on: ubuntu-latest
# 在runner上运行golang容器 # 移除容器配置以避免Docker Hub拉取超时问题
container: # 直接在GitHub托管的runner环境中执行任务
# 使用最新版本的golang镜像无需指定具体版本号
image: golang:latest-alpine
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4 # 使用最新稳定的v4版本
# Go environment is already provided by the container image
# GitHub Actions的runner环境通常已预装GoSetup Go步骤会处理版本管理
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable' # 使用最新稳定版本的Go无需手动更新版本号
- name: Install gf CLI - name: Install gf CLI
run: | run: |
# 直接下载GF CLI不使用缓存以避免超时问题
echo "Downloading GF CLI"
curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64 curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64
chmod +x gf chmod +x gf
mkdir -p "$HOME/bin" mkdir -p "$HOME/bin"
@@ -42,7 +45,7 @@ jobs:
run: gf build -ew -v "${{ github.ref_name }}" run: gf build -ew -v "${{ github.ref_name }}"
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4 # 使用v4版本
with: with:
name: p2p-${{ github.ref_name }} name: p2p-${{ github.ref_name }}
path: | path: |
@@ -53,16 +56,14 @@ jobs:
# runs-on指定了运行作业的虚拟机环境类型 # runs-on指定了运行作业的虚拟机环境类型
# 即使使用containerruns-on仍然是必要的配置 # 即使使用containerruns-on仍然是必要的配置
runs-on: ubuntu-latest runs-on: ubuntu-latest
# 在runner上运行golang容器 # 移除容器配置以避免Docker Hub拉取超时问题
container: # 直接在GitHub托管的runner环境中执行任务
# 使用最新版本的golang镜像无需指定具体版本号
image: golang:latest-alpine
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4 # 使用v4版本
with: with:
name: p2p-${{ github.ref_name }} name: p2p-${{ github.ref_name }}
path: bin path: bin
@@ -93,7 +94,7 @@ jobs:
ls -al dist ls -al dist
- name: Create GitHub Release - name: Create GitHub Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v2 # 更新到最新稳定的v2版本
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }} tag_name: ${{ github.ref_name }}