fix(ci): write NuGet config inline to allow HTTP source (NU1302)
NuGet 10 blocks HTTP sources by default. allowInsecureConnections=true must be set in a config file — the --source CLI flag doesn't support it. Write the config to /tmp/nuget.ci.config inline in the step so there is no dependency on any file existing in the workspace. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,18 @@ jobs:
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore src/Meezi.API/Meezi.API.csproj --source http://mirror:8081/repository/nuget-group/index.json
|
||||
run: |
|
||||
cat > /tmp/nuget.ci.config << 'EOF'
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nexus" value="http://mirror:8081/repository/nuget-group/index.json"
|
||||
protocolVersion="3" allowInsecureConnections="true" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
dotnet restore src/Meezi.API/Meezi.API.csproj --configfile /tmp/nuget.ci.config
|
||||
|
||||
- name: Build
|
||||
run: dotnet build src/Meezi.API/Meezi.API.csproj --no-restore -c Release
|
||||
@@ -107,7 +118,18 @@ jobs:
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore src/Meezi.Admin.API/Meezi.Admin.API.csproj --source http://mirror:8081/repository/nuget-group/index.json
|
||||
run: |
|
||||
cat > /tmp/nuget.ci.config << 'EOF'
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nexus" value="http://mirror:8081/repository/nuget-group/index.json"
|
||||
protocolVersion="3" allowInsecureConnections="true" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
dotnet restore src/Meezi.Admin.API/Meezi.Admin.API.csproj --configfile /tmp/nuget.ci.config
|
||||
|
||||
- name: Build
|
||||
run: dotnet build src/Meezi.Admin.API/Meezi.Admin.API.csproj --no-restore -c Release
|
||||
|
||||
Reference in New Issue
Block a user