Update for nuget

This commit is contained in:
Tiago Conceição
2021-06-12 22:50:23 +01:00
parent 4864bda887
commit cea97420a4
4 changed files with 44 additions and 7 deletions
+2
View File
@@ -354,3 +354,5 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
UVtools.Platforms/linux-x64/libcvextern.so
build/nuget_api.key
+14 -5
View File
@@ -1,9 +1,11 @@
# UVtools
[![License](https://img.shields.io/github/license/sn4k3/UVtools)](https://github.com/sn4k3/UVtools/blob/master/LICENSE)
[![GitHub repo size](https://img.shields.io/github/repo-size/sn4k3/UVtools)](https://github.com/sn4k3/UVtools)
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/sn4k3/UVtools?include_prereleases)](https://github.com/sn4k3/UVtools/releases)
[![Downloads](https://img.shields.io/github/downloads/sn4k3/UVtools/total)](https://github.com/sn4k3/UVtools/releases)
[![License](https://img.shields.io/github/license/sn4k3/UVtools?style=flat-square)](https://github.com/sn4k3/UVtools/blob/master/LICENSE)
[![GitHub repo size](https://img.shields.io/github/repo-size/sn4k3/UVtools?style=flat-square)](https://github.com/sn4k3/UVtools)
[![GitHub repo size](https://img.shields.io/github/languages/code-size/sn4k3/UVtools?style=flat-square)](https://github.com/sn4k3/UVtools)
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/sn4k3/UVtools?include_prereleases&style=flat-square)](https://github.com/sn4k3/UVtools/releases)
[![Downloads](https://img.shields.io/github/downloads/sn4k3/UVtools/total?style=flat-square)](https://github.com/sn4k3/UVtools/releases)
[![Nuget](https://img.shields.io/nuget/v/UVtools.Core?style=flat-square)](https://www.nuget.org/packages/UVtools.Core)
**MSLA/DLP, file analysis, calibration, repair, conversion and manipulation**
@@ -408,7 +410,14 @@ There are multiple ways to open your file:
# Library -> Developers
Are you a developer? This project include a .NET 5.0 library (UVtools.Core) that can be referenced in your application to make use of my work. Easy to use calls that allow you work with the formats. For more information navigate main code.
Are you a developer?
This project include a .NET 5.0 library (UVtools.Core) that can be referenced in your application to make use of my work.
Easy to use calls that allow you work with the formats. For more information navigate main code to see some calls.
Nuget package: https://www.nuget.org/packages/UVtools.Core
```powershell
dotnet add package UVtools.Core
```
## Develop and build from Source
+3 -1
View File
@@ -15,6 +15,8 @@
<PackageIcon>UVtools.png</PackageIcon>
<Platforms>AnyCPU;x64</Platforms>
<SignAssembly>false</SignAssembly>
<PackageIconUrl />
<PackageTags>msla, dlp, resin, printer, slicer, 3d printing, image processing, layers</PackageTags>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -39,7 +41,7 @@
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\UVtools.GUI\UVtools.png">
<None Include="..\UVtools.CAD\UVtools.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
+25 -1
View File
@@ -35,6 +35,7 @@ Set-Location $PSScriptRoot\..
$enableMSI = $true
#$buildOnly = 'linux-x64'
#$buildOnly = 'win-x64'
$enableNugetPublish = $true
# Profilling
$stopWatch = New-Object -TypeName System.Diagnostics.Stopwatch
$deployStopWatch = New-Object -TypeName System.Diagnostics.Stopwatch
@@ -130,6 +131,29 @@ $runtimes =
#Invoke-WebRequest -Uri $appImageUrl -OutFile $appImageFilePath
#wsl chmod a+x $appImageFilePath
if($null -ne $enableNugetPublish -and $enableNugetPublish)
{
$nugetApiKeyFile = 'build/nuget_api.key'
if (Test-Path -Path $nugetApiKeyFile -PathType Leaf)
{
Write-Output "Creating nuget package"
dotnet pack UVtools.Core --configuration 'Release'
$nupkg = "UVtools.Core/bin/Release/UVtools.Core.$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
}
}
}
return
foreach ($obj in $runtimes.GetEnumerator()) {
if(![string]::IsNullOrWhiteSpace($buildOnly) -and !$buildOnly.Equals($obj.Name)) {continue}
# Configuration
@@ -228,7 +252,7 @@ $stopWatch.Stop()
#>
# MSI Installer for Windows
if($enableMSI)
if($null -ne $enableMSI -and $enableMSI)
{
$deployStopWatch.Restart()
$runtime = 'win-x64'