-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publishing script and update project metadata
A PowerShell script called publish.ps1 has been added to automate the building, packaging, and publishing process for the project. Project metadata in Frank.PulseFlow.csproj and Directory.Build.props have also been updated to better describe the project and its properties. These changes streamline the production process and improve project documentation.
- Loading branch information
1 parent
27e3695
commit cbf9857
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
param ( | ||
[Parameter(Mandatory=$false)] | ||
[string]$version = (Get-Date -Format 'yyyy.MM.dd') | ||
) | ||
|
||
# Get directory of the script | ||
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition | ||
|
||
# Get path to the output directory | ||
$outputDirectory = "$scriptDirectory/.artifacts" | ||
|
||
# Get path to the publish directory | ||
$publishDirectory = "$outputDirectory/publish" | ||
|
||
# Get path to the package directory | ||
$packageDirectory = "$outputDirectory/packages" | ||
|
||
# Get path to the project file | ||
$projectFile = "$scriptDirectory/Frank.PulseFlow/Frank.PulseFlow.csproj" | ||
|
||
# Restore NuGet packages | ||
Write-Host "Restoring NuGet packages..." -ForegroundColor DarkCyan | ||
dotnet restore $projectFile | Out-Null | ||
|
||
# Clean output directories | ||
if (Test-Path $publishDirectory) { Remove-Item "$publishDirectory/*" -Recurse } | ||
if (Test-Path $packageDirectory) { Remove-Item "$packageDirectory/*" -Recurse } | ||
|
||
# Build the solution in the specified mode | ||
Write-Host "Building solution in Release mode..." -ForegroundColor DarkCyan | ||
dotnet build $projectFile --configuration Release --no-restore /p:Version=$version | Out-Null | ||
|
||
# Pack NuGet packages | ||
Write-Host "Packing NuGet packages..." -ForegroundColor DarkCyan | ||
dotnet pack $projectFile --configuration Release --output $packageDirectory --no-build /p:Version=$version /p:PackageVersion=$version | Out-Null | ||
|
||
# Publish the solution and pack NuGet packages | ||
Write-Host "Publishing the project..." -ForegroundColor DarkCyan | ||
dotnet publish $projectFile --configuration Release --output $publishDirectory --no-build /p:Version=$version /p:PackageVersion=$version | Out-Null | ||
Write-Host "Project has been published." -ForegroundColor Green |