mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
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:
27
.github/workflows/release.yml
vendored
27
.github/workflows/release.yml
vendored
@@ -17,15 +17,16 @@ jobs:
|
||||
# runs-on指定了运行作业的虚拟机环境类型
|
||||
# 即使使用container,runs-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指定了运行作业的虚拟机环境类型
|
||||
# 即使使用container,runs-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 }}
|
||||
|
||||
Reference in New Issue
Block a user