1+ $Config = " Release"
2+ $Framework = " net9.0"
3+ $Root = " $PSScriptRoot /../"
4+ $PublishDir = " $Root /Publish"
5+ $ArtifactsDir = " $Root /Publish/Artifacts"
6+ $Color = " DarkBlue"
7+
8+ Write-Host - BackgroundColor $Color " Clean up from previous publishes"
9+ Remove-Item - Path $PublishDir /* - Recurse - Force - ErrorAction Ignore | Out-Null
10+
11+ Write-Host - BackgroundColor $Color " Publish the dll files"
12+ dotnet publish $Root / Src/ FastData/ FastData.csproj - c $Config -f $Framework - p:GenerateDependencyFile= false - o $ArtifactsDir
13+ dotnet publish $Root / Src/ FastData.Generator.CSharp/ FastData.Generator.CSharp.csproj - c $Config -f $Framework - p:GenerateDependencyFile= false - o $ArtifactsDir
14+ dotnet publish $Root / Src/ FastData.Generator.CPlusPlus/ FastData.Generator.CPlusPlus.csproj - c $Config -f $Framework - p:GenerateDependencyFile= false - o $ArtifactsDir
15+ dotnet publish $Root / Src/ FastData.Generator.Rust/ FastData.Generator.Rust.csproj - c $Config -f $Framework - p:GenerateDependencyFile= false - o $ArtifactsDir
16+
17+ Write-Host - BackgroundColor $Color " Pack the PowerShell variant"
18+ New-Item - ItemType Directory - Path $PublishDir / PowerShell | Out-Null
19+ New-Item - ItemType Directory - Path $PublishDir / PowerShell/ lib | Out-Null
20+
21+ Write-Host - BackgroundColor $Color " Get the version number of the generator dll file"
22+ $ver = [System.Reflection.AssemblyName ]::GetAssemblyName(" $ArtifactsDir \Genbox.FastData.dll" ).Version
23+ $semver = " $ ( $ver.Major ) .$ ( $ver.Minor ) .$ ( $ver.Build ) "
24+
25+ Write-Host - BackgroundColor $Color " Version: $semver "
26+
27+ Write-Host - BackgroundColor $Color " Copy over the psd1 file, and update the version number in the process"
28+ (Get-Content $Root / Misc/ PowerShell/ FastData.psd1) -replace " TODO-VERSION" , " $semver " | Set-Content $PublishDir / PowerShell/ FastData.psd1
29+
30+ Write-Host - BackgroundColor $Color " Copy over the other PowerShell files"
31+ Copy-Item $Root / Misc/ PowerShell/ FastData.psm1 $PublishDir / PowerShell/ FastData.psm1
32+ Copy-Item $ArtifactsDir /* .dll $PublishDir / PowerShell/ lib/
33+
34+ Write-Host - BackgroundColor $Color " Pack the CLI tool as executable"
35+ dotnet publish $Root / Src/ FastData.Cli/ FastData.Cli.csproj - c $Config -f $Framework - r win- x64 - p:PublishSingleFile= true - p:SelfContained= true - p:PublishTrimmed= true - p:TargetFrameworks= $Framework - p:DebugType= none - p:GenerateDocumentationFile= false - p:EnableCompressionInSingleFile= true - p:InvariantGlobalization= true - o $PublishDir
36+
37+ Write-Host - BackgroundColor $Color " Pack the CLI tool as a dotnet tool (NuGet)"
38+ dotnet pack $Root / Src/ FastData.Cli/ FastData.Cli.csproj - c $Config - p:PackAsTool= true - p:ToolCommandName= fastdata - p:PackageVersion= $semver - o $PublishDir
39+
40+ Write-Host - BackgroundColor $Color " Pack the source generator"
41+ dotnet pack $Root / Src/ FastData.SourceGenerator/ FastData.SourceGenerator.csproj - c $Config - p:PackageVersion= $semver - o $PublishDir
42+
43+ # Write-Host -BackgroundColor $Color "Publish PowerShell module to PowerShellGallery"
44+ # Publish-Module -Path "$PublishDir/PowerShell/" -NuGetApiKey $env:PWSHG_KEY
45+
46+ # Write-Host -BackgroundColor $Color "Publish dotnet tool to NuGet"
47+ # dotnet nuget push $PublishDir/*.nupkg --api-key $env:NUGET_KEY
0 commit comments