feat: 版本切至 1.0.0-preview.1,CI push 步骤改走 nuget.config 带凭据

- Directory.Build.props: YhPlatformNetVersion 1.0.0 -> 1.0.0-preview.1(核对表 #6~#9/#12 未实调先发预发布)
- ci.yml: Push to Nexus 步骤改为动态生成带凭据的 nuget.config(allowInsecureConnections + packageSourceCredentials),去掉不适用的 --skip-duplicate
This commit is contained in:
wanghu
2026-09-02 11:18:43 +08:00
parent 8774b6cc44
commit 0f232f0a75
2 changed files with 23 additions and 8 deletions
+20 -6
View File
@@ -44,9 +44,23 @@ jobs:
run: dotnet pack yh-platform-net.sln -c Release -o artifacts run: dotnet pack yh-platform-net.sln -c Release -o artifacts
- name: Push to Nexus - name: Push to Nexus
run: > # Nexus 的 NuGet 推送认证走 HTTP Basic(账号+密码),不校验 api-key;
dotnet nuget push "artifacts/*.nupkg" # 且 Nexus 为 http 源,SDK 8 需在 nuget.config 显式 allowInsecureConnections=true。
--source ${{ secrets.NEXUS_URL }} # 动态生成带凭据的 nuget.config 并指定 --configfile,避免凭据入 git。
--username ${{ secrets.NEXUS_USER }} run: |
--password "${{ secrets.NEXUS_PASS }}" cat > nuget-push.config <<EOF
--api-key nexus --skip-duplicate <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nexus-nuget" value="${{ secrets.NEXUS_URL }}" allowInsecureConnections="true" />
</packageSources>
<packageSourceCredentials>
<nexus-nuget>
<add key="Username" value="${{ secrets.NEXUS_USER }}" />
<add key="ClearTextPassword" value="${{ secrets.NEXUS_PASS }}" />
</nexus-nuget>
</packageSourceCredentials>
</configuration>
EOF
dotnet nuget push "artifacts/*.nupkg" --source nexus-nuget --configfile nuget-push.config --api-key nexus
+3 -2
View File
@@ -9,8 +9,9 @@
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<!-- 包版本统一随 YhPlatformNetVersion 走(对齐 BOM 集中钉版本) --> <!-- 包版本统一随 YhPlatformNetVersion 走(对齐 BOM 集中钉版本)
<YhPlatformNetVersion>1.0.0</YhPlatformNetVersion> 1.0.0-preview.1:核对表 #6~#9/#12 未实调,先发预发布;实调通过再定 1.0.0 -->
<YhPlatformNetVersion>1.0.0-preview.1</YhPlatformNetVersion>
<Version>$(YhPlatformNetVersion)</Version> <Version>$(YhPlatformNetVersion)</Version>
<Authors>yunhai-platform</Authors> <Authors>yunhai-platform</Authors>
<Company>yunhai</Company> <Company>yunhai</Company>