Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2021-06-16 01:29:45 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2021-06-16 01:29:45 +0300
commit3888f187bb27ad13dce9ad2912710b17839a04b5 (patch)
tree5b9706b3a7e3f35df2923b3ed9048bf1d38284cf /build
parent5217f9ff22f4d9a11cc00e95f00ebdf2cd4d451c (diff)
Create UVtools.AvaloniaControls
Diffstat (limited to 'build')
-rw-r--r--build/NugetPublish_UVtools.AvaloniaControls.ps137
1 files changed, 37 insertions, 0 deletions
diff --git a/build/NugetPublish_UVtools.AvaloniaControls.ps1 b/build/NugetPublish_UVtools.AvaloniaControls.ps1
new file mode 100644
index 0000000..d01c2a8
--- /dev/null
+++ b/build/NugetPublish_UVtools.AvaloniaControls.ps1
@@ -0,0 +1,37 @@
+Set-Location $PSScriptRoot\..
+####################################
+### Configuration ###
+####################################
+# Variables
+$package = "UVtools.AvaloniaControls"
+$nugetApiKeyFile = 'build/nuget_api.key'
+$outputFolder = "$package/bin/Release"
+
+$projectXml = [Xml] (Get-Content "$package\$package.csproj")
+$version = "$($projectXml.Project.PropertyGroup.Version)".Trim();
+if([string]::IsNullOrWhiteSpace($version)){
+ Write-Error "Can not detect the $package version, does $project\$project.csproj exists?"
+ exit
+}
+
+if (Test-Path -Path $nugetApiKeyFile -PathType Leaf)
+{
+ Write-Output "Creating nuget package for $package $version"
+ #Remove-Item "$outputFolder/*" -Recurse -Include *.nupkg
+ dotnet pack $package --configuration 'Release'
+
+ $nupkg = "$outputFolder/$package.$version.nupkg"
+
+ if (Test-Path -Path $nupkg -PathType Leaf){
+ $nugetApiKeyFile = (Get-Content $nugetApiKeyFile)
+ #dotnet nuget push $nupkg --api-key $nugetApiKeyFile --source https://api.nuget.org/v3/index.json
+ #Remove-Item $nupkg
+ }else {
+ Write-Error "Nuget package publish failed!"
+ Write-Error "File '$nupkg' was not found"
+ return
+ }
+}
+else{
+ Write-Error "The nuget API key was not found. This is private and can only use used by own developer"
+} \ No newline at end of file