EgwWPFBaseLib 2.7.10.1:

- aggiunta creazione nuget
This commit is contained in:
Emmanuele Sassi
2025-10-23 16:38:09 +02:00
parent 6aa70f7472
commit 247cf3e1f9
5 changed files with 269 additions and 4 deletions
+220
View File
@@ -0,0 +1,220 @@
variables:
VERS_MAIN: '0.9'
NEW_REL: ''
NUM_REL: '0.1.2.3'
NU_TYPE: 'Debug'
NEXUS_PATH: 'EgwMEM'
PROJ_PATH: ''
APP_NAME: 'EgwWPFBaseLib'
SOL_NAME: 'EgwWPFBaseLib'
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
DEST: 'install'
# nota: cer creazione rules: https://docs.gitlab.com/ee/ci/jobs/job_control.html#common-if-clauses-for-rules
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
echo "esecuzione Nuget FIX steps"
dotnet nuget list source
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus Proxy`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source nexus-proxy-v3
}
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-hosted"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source nexus-hosted
}
$hasSource = dotnet nuget list source | Select-String -Pattern "Microsoft Visual Studio Offline Packages"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source 'Microsoft Visual Studio Offline Packages'
}
echo "Situazione sorgenti post remove:"
dotnet nuget list source
dotnet nuget add source https://nexus.steamware.net/repository/nuget-proxy-v3/index.json -n nexus-proxy-v3 -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
dotnet nuget add source https://nexus.steamware.net/repository/nuget-hosted/ -n nexus-hosted -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
$hasSource = dotnet nuget list source
echo "Situazione sorgenti FINALE:"
dotnet nuget list source
# helper creazione hash files x IIS
.hashBuild: &hashBuild
- |
$Target = $env:APP_NAME + "\bin\publish\" + $env:APP_NAME + ".zip"
$MD5 = Get-FileHash $Target -Algorithm MD5
$SHA1 = Get-FileHash $Target -Algorithm SHA1
New-Item $Target".md5"
New-Item $Target".sha1"
$MD5.Hash | Set-Content -Path $Target".md5"
$SHA1.Hash | Set-Content -Path $Target".sha1"
echo "Created HASH files for $Target"
# helper x send su NEXUS x pack
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
$fileVers = $env:APP_NAME + "\Resources\VersNum.txt"
$VersNumb = Get-Content $fileVers
echo "Curr Version: $VersNumb"
if($CI_COMMIT_BRANCH -eq "master")
{
$version = "stable"
}
else
{
$version = "unstable"
}
$File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
}
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# helper x fix nuspec file: se debug aggiunge -beta nel blocco 3 del SemVer
.nuspec-fix: &nuspec-fix
- |
echo "Modifica dati versione pacchetto nuget"
$fileNameRel = "$env:APP_NAME/$env:APP_NAME.vbproj";
$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"
# 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"
if ($env:NU_TYPE -eq "Debug")
{
$fileNameRel = "$env:APP_NAME.Debug.nuspec";
}
elseif($env:NU_TYPE -eq "Release")
{
$fileNameRel = "$env:APP_NAME.Release.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
- deploy
- release
# --------------------------------
# BUILD
# --------------------------------
EgwWPFBaseLib:SDK:build:
stage: build
tags:
- win
variables:
APP_NAME: EgwWPFBaseLib
SOL_NAME: EgwWPFBaseLib
NUGET_PACKAGES: 'C:\.nuget\packages' # force global packages folder
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'main'
- if: $CI_COMMIT_BRANCH =~ /^feature\/EgwWPFBaseLib.+/
when: always
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -PackagesDirectory "c:\.nuget\packages"'
script:
- echo $CI_COMMIT_BRANCH
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Debug /p:OutputPath=bin/ /verbosity:minimal /m'
# --------------------------------
# DEPLOY develop (beta nuget)
# --------------------------------
EgwWPFBaseLib:SDK:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: EgwWPFBaseLib
SOL_NAME: EgwWPFBaseLib
NUGET_PACKAGES: 'C:\.nuget\packages' # force global packages folder
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/EgwWPFBaseLib.+/
when: always
needs: ["EgwWPFBaseLib:SDK:build"]
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -PackagesDirectory "c:\.nuget\packages"'
- *nuspec-fix-framework
script:
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Debug /verbosity:minimal /m'
- '& "$env:NUGET_PATH" pack "$env:APP_NAME.Debug.nuspec"'
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
- '& "$env:NUGET_PATH" push "$env:APP_NAME.$env:NUM_REL.nupkg" -Source http://nexus.steamware.net/repository/nuget-hosted'
# --------------------------------
# RELEASE (tags only + sdk)
# --------------------------------
EgwWPFBaseLib:SDK:release:
stage: release
tags:
- win
variables:
APP_NAME: EgwWPFBaseLib
SOL_NAME: EgwWPFBaseLib
NU_TYPE: Release
rules:
- if: $CI_COMMIT_BRANCH == 'main'
needs: ["EgwWPFBaseLib:SDK:build"]
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -PackagesDirectory "c:\.nuget\packages"'
- *nuspec-fix-framework
script:
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Release /verbosity:minimal /m'
- '& "$env:NUGET_PATH" pack "$env:APP_NAME.Release.nuspec"'
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
- '& "$env:NUGET_PATH" push "$env:APP_NAME.$env:NUM_REL.nupkg" -Source http://nexus.steamware.net/repository/nuget-hosted'
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>EgwWPFBaseLib</id>
<version>2.7.10.1</version>
<title>EgwWPFBaseLib</title>
<authors>Emmanuele Sassi</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<!-- <icon>icon.png</icon> -->
<description>EgwWPFBaseLib</description>
<copyright>Copyright © 2020-2025 by Egalware s.r.l.</copyright>
<dependencies>
<dependency id="Newtonsoft.Json" version="13.0.4" />
</dependencies>
</metadata>
<files>
<file src="EgwWPFBaseLib\bin\Debug\Egw*.dll" target="lib" />
<file src="EgwWPFBaseLib\bin\Debug\Egw*.config" target="lib" />
<file src="EgwWPFBaseLib\bin\Debug\Egw*.pdb" target="lib" />
</files>
</package>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>EgwWPFBaseLib</id>
<version>2.7.10.1</version>
<title>EgwWPFBaseLib</title>
<authors>Emmanuele Sassi</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<!-- <icon>icon.png</icon> -->
<description>EgwWPFBaseLib</description>
<copyright>Copyright © 2020-2025 by Egalware s.r.l.</copyright>
<dependencies>
<dependency id="Newtonsoft.Json" version="13.0.4" />
</dependencies>
</metadata>
<files>
<file src="EgwWPFBaseLib\bin\Release\Egw*.dll" target="lib" />
</files>
</package>
+5
View File
@@ -121,6 +121,11 @@
<ItemGroup>
<Resource Include="Readme.html" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.4</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\Effector\EgwWPFBaseLib.dll</PostBuildEvent>
+4 -4
View File
@@ -13,9 +13,9 @@ Imports System.Windows
<Assembly: AssemblyTitle("EgwWPFBaseLib")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Windows User")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgwWPFBaseLib")>
<Assembly: AssemblyCopyright("Copyright @ Windows User 2025")>
<Assembly: AssemblyCopyright("Copyright © 2020-2025 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -52,5 +52,5 @@ Imports System.Windows
' Revision
'
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: AssemblyVersion("2.7.10.1")>
<Assembly: AssemblyFileVersion("2.7.10.1")>