diff --git a/publish-packages.ps1 b/publish-packages.ps1 new file mode 100644 index 0000000..4b2ae84 --- /dev/null +++ b/publish-packages.ps1 @@ -0,0 +1,88 @@ +#!/usr/bin/env pwsh + +<# +.SYNOPSIS + Publishes all NuGet packages from bin/Release folders to the DS source. + +.DESCRIPTION + This script searches for all .nupkg files in bin/Release folders and publishes them + using dotnet push with the DS source and az key. + +.EXAMPLE + .\publish-packages.ps1 +#> + +[CmdletBinding()] +param() + +$ErrorActionPreference = "Stop" + +# Get the script directory (project root) +$projectRoot = $PSScriptRoot + +Write-Host "Searching for NuGet packages in bin/Release folders..." -ForegroundColor Cyan + +# Find all .nupkg files in bin/Release folders, excluding symbols packages +$allPackages = Get-ChildItem -Path $projectRoot -Filter "*.nupkg" -Recurse | + Where-Object { + $_.FullName -match "bin\\Release" -and + $_.Name -notlike "*.symbols.nupkg" + } + +# Group by directory and select only the most recent package from each folder +$packages = $allPackages | + Group-Object -Property DirectoryName | + ForEach-Object { + $_.Group | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1 + } + +if ($packages.Count -eq 0) { + Write-Host "No NuGet packages found in bin/Release folders." -ForegroundColor Yellow + Write-Host "Make sure to build the solution in Release configuration first." -ForegroundColor Yellow + exit 1 +} + +Write-Host "Found $($packages.Count) package(s) to publish:" -ForegroundColor Green +foreach ($package in $packages) { + Write-Host " - $($package.Name)" -ForegroundColor Gray +} + +Write-Host "" + +# Publish each package +$successCount = 0 +$failCount = 0 + +foreach ($package in $packages) { + Write-Host "Publishing $($package.Name)..." -ForegroundColor Cyan + + try { + # Execute dotnet push + dotnet nuget push -s DS -k az $package.FullName + + if ($LASTEXITCODE -eq 0) { + Write-Host " ✓ Successfully published $($package.Name)" -ForegroundColor Green + $successCount++ + } else { + Write-Host " ✗ Failed to publish $($package.Name) (exit code: $LASTEXITCODE)" -ForegroundColor Red + $failCount++ + } + } catch { + Write-Host " ✗ Error publishing $($package.Name): $_" -ForegroundColor Red + $failCount++ + } + + Write-Host "" +} + +# Summary +Write-Host "========================================" -ForegroundColor Cyan +Write-Host "Publication Summary:" -ForegroundColor Cyan +Write-Host " Success: $successCount" -ForegroundColor Green +Write-Host " Failed: $failCount" -ForegroundColor $(if ($failCount -gt 0) { "Red" } else { "Gray" }) +Write-Host "========================================" -ForegroundColor Cyan + +if ($failCount -gt 0) { + exit 1 +} + diff --git a/src/core/Dime.Repositories.Sql/Dime.Repositories.Sql.csproj b/src/core/Dime.Repositories.Sql/Dime.Repositories.Sql.csproj index 13f5ebb..bc53d79 100644 --- a/src/core/Dime.Repositories.Sql/Dime.Repositories.Sql.csproj +++ b/src/core/Dime.Repositories.Sql/Dime.Repositories.Sql.csproj @@ -1,13 +1,13 @@  - 2.0.3.0 - 2.0.3.0 - 2.0.3.0 + 3.0.0.0 + 3.0.0.0 + 3.0.0.0 Dime Software - 2.0.3.0 + 3.0.0.0-alpha.1 Dime Software - net8.0 + net10.0 Dime.Repositories.Sql Dime.Repositories.Sql https://cdn.dime-software.com/dime-software/logo-shape.png @@ -19,7 +19,7 @@ Repository contracts with support for SQL databases True True - Copyright © 2024 + Copyright © 2025 https://github.com/dimesoftware/repository https://github.com/dimesoftware/repository @@ -32,6 +32,6 @@ - + diff --git a/src/core/Dime.Repositories/Dime.Repositories.csproj b/src/core/Dime.Repositories/Dime.Repositories.csproj index 501e91b..14859f6 100644 --- a/src/core/Dime.Repositories/Dime.Repositories.csproj +++ b/src/core/Dime.Repositories/Dime.Repositories.csproj @@ -1,11 +1,11 @@  - 2.0.1.0 - 2.0.1.0 - 2.0.1.0 + 3.0.0.0 + 3.0.0.0 + 3.0.0.0 Dime Software - 2.0.1.0 - net8.0 + 3.0.0.0-alpha.1 + net10.0 Dime.Repositories Dime.Repositories https://cdn.dime-software.com/dime-software/logo-shape.png @@ -17,7 +17,7 @@ true True True - Copyright © 2024 + Copyright © 2025 https://github.com/dimesoftware/repository https://github.com/dimesoftware/repository git diff --git a/src/providers/EntityFramework/Dime.Repositories.Sql.EntityFramework.csproj b/src/providers/EntityFramework/Dime.Repositories.Sql.EntityFramework.csproj index be3f19d..fa8fabc 100644 --- a/src/providers/EntityFramework/Dime.Repositories.Sql.EntityFramework.csproj +++ b/src/providers/EntityFramework/Dime.Repositories.Sql.EntityFramework.csproj @@ -1,9 +1,9 @@  - 2.0.3.0 - 2.0.3.0 - 2.0.3.0 + 3.0.0.0 + 3.0.0.0 + 3.0.0.0 latest @@ -19,23 +19,23 @@ Dime Software - net8.0 + net10.0 Dime.Repositories.Sql.EntityFramework Dime.Repositories.Sql.EntityFramework Entity Framework;Repository;SQL https://cdn.dime-software.com/dime-software/logo-shape.png - 2.0.3.0 + 3.0.0.0-alpha.1 Implementation of the repository pattern with Microsoft SQL using Entity Framework Core - Copyright © 2024 + Copyright © 2025 https://github.com/dimesoftware/repository https://github.com/dimesoftware/repository git - - - + + + diff --git a/src/test/Dime.Repositories.Sql.EntityFramework.Tests/Dime.Repositories.Sql.EntityFramework.Tests.csproj b/src/test/Dime.Repositories.Sql.EntityFramework.Tests/Dime.Repositories.Sql.EntityFramework.Tests.csproj index 470fece..f3a4e1d 100644 --- a/src/test/Dime.Repositories.Sql.EntityFramework.Tests/Dime.Repositories.Sql.EntityFramework.Tests.csproj +++ b/src/test/Dime.Repositories.Sql.EntityFramework.Tests/Dime.Repositories.Sql.EntityFramework.Tests.csproj @@ -1,16 +1,16 @@  - net8.0 + net10.0 false - - - - + + + +