From ba91bd9edb645982358c4bc0305b2011b56bc2ca Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 7 Aug 2024 08:26:42 +0200 Subject: [PATCH] Update yaml x produrre nuget package --- .gitlab-ci.yml | 97 +++++++++++++++++++++++++++++++++-- EgwProxy.LiMan.Debug.nuspec | 24 +++++++++ EgwProxy.LiMan.Release.nuspec | 23 +++++++++ EgwProxy.LiMan.sln | 6 +++ 4 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 EgwProxy.LiMan.Debug.nuspec create mode 100644 EgwProxy.LiMan.Release.nuspec diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2085af8..95c6fd8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ variables: + VERS_MAIN: '1.0' NEXUS_PATH: 'LiMan' APP_NAME: 'LiMan.UI' + NUGET_PATH: 'C:\Tools\nuget.exe' # helper x fix pacchetti nuget da repo locale nexus.steamware.net .nuget-fix: &nuget-fix @@ -91,11 +93,32 @@ variables: # mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip # image: mcr.microsoft.com/dotnet/sdk:6.0 + +# helper x fix version number +.version-fix: &version-fix + - | + $env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH) + $env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH) + $env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH) + $env:NEW_COPYRIGHT = "EgalWare @ 2021-" + (get-date -format yyyy) + #$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw + #$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL + #$newContenuto = $newContenuto -replace 'EgalWare © 2021', $env:NEW_COPYRIGHT + #$newContenuto | Set-Content -Path 'VersGen\VersGen.cs' + # display versioni generate + $resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB; + Write-Output $resoconto; + echo "Replace completati" stages: - build - deploy + - release + +# -------------------------------- +# BUILD +# -------------------------------- UI:build: stage: build tags: @@ -125,8 +148,25 @@ Transfer:build: - dotnet restore LiMan.sln script: - dotnet build LiMan.Transfer/LiMan.Transfer.csproj - - + +EgwProxy.LiMan:build: + stage: build + tags: + - win + variables: + APP_NAME: EgwProxy.LiMan + SOL_NAME: EgwProxy.LiMan + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet' + script: + - echo $CI_COMMIT_BRANCH + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + + +# -------------------------------- +# DEPLOY +# -------------------------------- UI:IIS01:deploy: stage: deploy tags: @@ -206,7 +246,58 @@ Transfer:deploy: - *hashBuild - *nexusUpload - +EgwProxy.LiMan:staging: + stage: staging + needs: ["EgwProxy.LiMan:build"] + tags: + - win + variables: + CONFIG: Debug + APP_NAME: EgwProxy.LiMan + SOL_NAME: EgwProxy.LiMan + only: + refs: + - develop + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -verbosity quiet' + - *version-fix + - *nuspec-fix + script: +# - '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m' + - dotnet build "$env:APP_NAME\$env:APP_NAME.csproj" + - '& Remove-Item *.nupkg' + - '& $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:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted' + +# -------------------------------- +# RELEASE +# -------------------------------- +EgwProxy.LiMan:release: + stage: release + needs: ["EgwProxy.LiMan:build"] + tags: + - win + variables: + CONFIG: Release + APP_NAME: EgwProxy.LiMan + SOL_NAME: EgwProxy.LiMan + only: + refs: + - SDK + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -verbosity quiet' + - *version-fix + - *nuspec-fix + script: + - dotnet build "$env:APP_NAME\$env:APP_NAME.csproj" + - '& Remove-Item *.nupkg' + - '& $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:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted' + # UI:installer: # stage: installer # tags: diff --git a/EgwProxy.LiMan.Debug.nuspec b/EgwProxy.LiMan.Debug.nuspec new file mode 100644 index 0000000..78bd44c --- /dev/null +++ b/EgwProxy.LiMan.Debug.nuspec @@ -0,0 +1,24 @@ + + + + EgwProxy.LiMan + #version# + EgwProxy.LiMan + Samuele E. Locatelli, EgalWare + false + MIT + Libreria per comunicazione REST con server LiMan - beta/unstable + #releaseNotes# + #copyright# + EgwProxy.LiMan LiMan Rest + + + + + + + + + + + \ No newline at end of file diff --git a/EgwProxy.LiMan.Release.nuspec b/EgwProxy.LiMan.Release.nuspec new file mode 100644 index 0000000..661c716 --- /dev/null +++ b/EgwProxy.LiMan.Release.nuspec @@ -0,0 +1,23 @@ + + + + EgwProxy.LiMan + #version# + EgwProxy.LiMan + Samuele E. Locatelli, EgalWare + false + MIT + Libreria per comunicazione REST con server LiMan + #releaseNotes# + #copyright# + EgwProxy.LiMan LiMan Rest + + + + + + + + + + \ No newline at end of file diff --git a/EgwProxy.LiMan.sln b/EgwProxy.LiMan.sln index d73e67e..e1696f2 100644 --- a/EgwProxy.LiMan.sln +++ b/EgwProxy.LiMan.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.LiMan", "EgwProxy. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.LiMan.ConsoleTest", "EgwProxy.LiMan.ConsoleTest\EgwProxy.LiMan.ConsoleTest.csproj", "{5DADD362-4B14-45AD-AB0A-B30361D7449B}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestWinFormVB", "TestWinFormVB\TestWinFormVB.vbproj", "{CC0A7D8F-0888-45F5-B791-FCD90349CD21}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {5DADD362-4B14-45AD-AB0A-B30361D7449B}.Debug|Any CPU.Build.0 = Debug|Any CPU {5DADD362-4B14-45AD-AB0A-B30361D7449B}.Release|Any CPU.ActiveCfg = Release|Any CPU {5DADD362-4B14-45AD-AB0A-B30361D7449B}.Release|Any CPU.Build.0 = Release|Any CPU + {CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE