FreeSql/nuget/build-and-push.ps1
2024-11-13 18:18:28 +08:00

62 lines
2.1 KiB
PowerShell

# 定义参数
Param(
# Nuget APIKey
[string] $apikey
)
if ($apikey -eq $null -or $apikey -eq "")
{
Write-Error "必须指定apiKey";
return;
}
rm -r ../FreeSql.DbContext/bin/Release
dotnet build -c Release ../FreeSql.sln
$files = Get-ChildItem -Path ../FreeSql/bin/Release -Filter *-ns*.nupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../FreeSql/bin/Release -Filter *-ns*.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../Providers/FreeSql.Provider.Sqlite/bin/Release -Filter *-ns*.nupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../Providers/FreeSql.Provider.Sqlite/bin/Release -Filter *-ns*.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../Providers/FreeSql.Provider.SqlServer/bin/Release -Filter *-ns*.nupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../Providers/FreeSql.Provider.SqlServer/bin/Release -Filter *-ns*.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../FreeSql.DbContext/bin/Release -Filter *-ns*.nupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../FreeSql.DbContext/bin/Release -Filter *-ns*.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}