mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-04 17:29:22 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a5432406a | ||
|
|
7b16777411 |
31
.github/workflows/release.yml
vendored
31
.github/workflows/release.yml
vendored
@@ -23,13 +23,15 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4 # 使用最新稳定的v4版本
|
||||
|
||||
# GitHub Actions的runner环境通常已预装Go,Setup Go步骤会处理版本管理
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 'stable' # 使用最新稳定版本的Go,无需手动更新版本号
|
||||
|
||||
- name: Install gf CLI
|
||||
run: |
|
||||
# 直接下载GF CLI,不使用缓存以避免超时问题
|
||||
echo "Downloading GF CLI"
|
||||
curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64
|
||||
chmod +x gf
|
||||
mkdir -p "$HOME/bin"
|
||||
@@ -42,9 +44,17 @@ jobs:
|
||||
- name: Build with gf
|
||||
run: gf build -ew -v "${{ github.ref_name }}"
|
||||
|
||||
- name: Upload build artifacts
|
||||
# 使用main分支以获取最新版本的action,无需手动更新版本号
|
||||
uses: actions/upload-artifact@main
|
||||
- name: Upload build artifacts (GitHub)
|
||||
if: contains(github.server_url, 'github.com')
|
||||
uses: actions/upload-artifact@v4 # GitHub使用v4版本以避免废弃警告
|
||||
with:
|
||||
name: p2p-${{ github.ref_name }}
|
||||
path: |
|
||||
bin/**
|
||||
|
||||
- name: Upload build artifacts (Gitea)
|
||||
if: ${{ github.server_url != 'https://github.com' || env.GITEA_ACTIONS == 'true' }}
|
||||
uses: actions/upload-artifact@v3 # Gitea使用v3版本以兼容GHES
|
||||
with:
|
||||
name: p2p-${{ github.ref_name }}
|
||||
path: |
|
||||
@@ -61,9 +71,16 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download artifacts
|
||||
# 使用main分支以获取最新版本的action,无需手动更新版本号
|
||||
uses: actions/download-artifact@main
|
||||
- name: Download artifacts (GitHub)
|
||||
if: contains(github.server_url, 'github.com')
|
||||
uses: actions/download-artifact@v4 # GitHub使用v4版本以避免废弃警告
|
||||
with:
|
||||
name: p2p-${{ github.ref_name }}
|
||||
path: bin
|
||||
|
||||
- name: Download artifacts (Gitea)
|
||||
if: contains(github.server_url, 'gitea')
|
||||
uses: actions/download-artifact@v3 # Gitea使用v3版本以兼容GHES
|
||||
with:
|
||||
name: p2p-${{ github.ref_name }}
|
||||
path: bin
|
||||
|
||||
Reference in New Issue
Block a user