1 Commits

Author SHA1 Message Date
Yue-bin
7c203f130a chore(workflow): 配置华为云和腾讯云NuGet镜像以提升包恢复速度
Some checks failed
Publish Release / build (push) Failing after 4m16s
# 华为云和腾讯云的 NuGet 镜像配置
- 替换原有的网络诊断步骤为NuGet镜像配置
- 添加华为云和腾讯云的NuGet源到nuget.config文件
- 修改dotnet restore命令使用配置文件而非直接指定源地址
2026-06-10 17:41:36 +08:00

View File

@@ -19,19 +19,22 @@ jobs:
with: with:
dotnet-version: 8.0.x dotnet-version: 8.0.x
- name: Diagnose network # 华为云和腾讯云的 NuGet 镜像配置
- name: Configure NuGet mirror
run: | run: |
echo "=== DNS test ===" cat > nuget.config << 'EOF'
nslookup api.nuget.org || dig api.nuget.org || echo "DNS failed" <?xml version="1.0" encoding="utf-8"?>
echo "=== Curl test (nuget.org) ===" <configuration>
curl -v --connect-timeout 10 https://api.nuget.org/v3/index.json 2>&1 || echo "curl failed" <packageSources>
echo "=== Curl test (huawei mirror) ===" <clear />
curl -v --connect-timeout 10 https://repo.huaweicloud.com/repository/nuget/v3/index.json 2>&1 || echo "curl failed" <add key="huawei-mirror" value="https://repo.huaweicloud.com/repository/nuget/v3/index.json" />
echo "=== Proxy env ===" <add key="tencent" value="https://mirrors.cloud.tencent.com/nuget/" />
env | grep -i proxy || echo "no proxy set" </packageSources>
</configuration>
EOF
- name: Restore dependencies - name: Restore dependencies
run: dotnet restore --source "https://repo.huaweicloud.com/repository/nuget/v3/index.json" run: dotnet restore
- name: Build - name: Build
run: dotnet build --no-restore --configuration Release run: dotnet build --no-restore --configuration Release