fix calcolo num versione e id pacchetto

This commit is contained in:
Emmanuele Sassi
2025-09-30 19:00:50 +02:00
parent 41d2413290
commit 633ea2ebf2
3 changed files with 27 additions and 3 deletions
+25 -1
View File
@@ -106,6 +106,30 @@ variables:
Set-Content -Path $fileNameRel -Value $newContent;
echo "Modifica dati file progetto x nuspec completata su file $fileNameRel"
# helper x fix nuspec file: se debug aggiunge -beta nel blocco 3 del SemVer
.nuspec-fix-framework: &nuspec-fix-framework
- |
echo "Modifica dati versione pacchetto nuget x progetti Framework"
$fileNameRel = "$env:APP_NAME/$env:APP_NAME.nuspec";
$fileContent = Get-Content $fileNameRel -Raw;
$pattern = '(?i)<Version>\s*(.*?)\s*</Version>'
$vers = if ($fileContent -match $pattern) { $matches[1] } else { $null }
echo "Versione corrente: $vers"
if ($env:NU_TYPE -eq "Debug")
{
$env:NUM_REL = $vers -replace '^(\d+)\.(\d+)\.(\d+)\.(\d+)$', '$1.$2.$3-beta.$4'
}
elseif($env:NU_TYPE -eq "Release")
{
$env:NUM_REL = $vers
}
echo "Versione calcolata: $env:NUM_REL"
$findVers = "<Version>(.|\n)*?</Version>";
$replVers = "<Version>" + $env:NUM_REL + "</Version>";
$newContent = $fileContent -replace $findVers, $replVers;
Set-Content -Path $fileNameRel -Value $newContent;
echo "Modifica dati file progetto x nuspec completata su file $fileNameRel"
# Stages previsti
stages:
- build
@@ -200,7 +224,7 @@ EgwMultiEngineManager.Core:SDK:deploy:
- *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln" --packages "c:\.nuget\packages"
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -PackagesDirectory "c:\.nuget\packages"'
- *nuspec-fix
- *nuspec-fix-framework
script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.vbproj
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Debug /verbosity:minimal /m'
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>7b2a764c-f972-434c-9598-168218eac7b0</id>
<id>EgwMultiEngineManager.Core</id>
<version>2.7.9.5</version>
<title>EgwMultiEngineManager.Core</title>
<authors>Emmanuele Sassi</authors>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>7b2a764c-f972-434c-9598-168218eac7b0</id>
<id>EgwMultiEngineManager.Core</id>
<version>2.7.9.5</version>
<title>EgwMultiEngineManager.Core</title>
<authors>Emmanuele Sassi</authors>