8 Commits

Author SHA1 Message Date
Samuele Locatelli fcf2dab1b5 YAML:
- correzione path provenienza file
2022-08-04 18:52:37 +02:00
Samuele Locatelli aa6dc68c00 fix typo msi name 2022-08-04 18:48:45 +02:00
Samuele Locatelli 522767403d PAckage msi:
-update gestione hash x msi sour
- fix upload nexus
2022-08-04 18:46:29 +02:00
Samuele Locatelli b810502245 pulizia yaml 2022-08-04 18:39:02 +02:00
Samuele Locatelli 0ee160652f typo correct == --> = 2022-08-04 16:23:29 +02:00
Samuele Locatelli 013d9287a3 FIX yaml 2022-08-04 14:43:25 +02:00
Samuele Locatelli 0b6bb44fd0 bozza yaml 2022-08-04 13:12:45 +02:00
Samuele Locatelli 7fc27e39eb Bozza iniziale yaml 2022-08-04 13:00:39 +02:00
2 changed files with 115 additions and 0 deletions
+115
View File
@@ -0,0 +1,115 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
NEXUS_PATH: 'SOUR'
APP_NAME: 'SOUR'
SOL_NAME: 'SOUR'
CONFIG: 'Release'
VERS_MAIN: '2.0'
NEW_REL: ''
OUTPUT_DIR: ''
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
# $env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+$CI_PIPELINE_IID
# helper x fix version number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+(get-date format dHH)
$contenuto = Get-Content -path 'src\SharedAssemblyInfo.cs' -Raw
$newContenuto = $contenuto -replace '1.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -Path 'src\SharedAssemblyInfo.cs'
echo "Set vers: $env:NEW_REL"
if($CI_COMMIT_BRANCH = "develop")
{
$env:CONFIG = "Debug"
}
# helper creazione hash files
.hashBuild: &hashBuild
- |
$Target = "src\SOUR.Setup\bin\SOUR.msi"
$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
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$VersNumb = $env:NEW_REL
echo "Curr Version: $VersNumb"
$FileMsi="src\SOUR.Setup\bin\SOUR.msi"
$FileName="SOUR.msi"
if($CI_COMMIT_BRANCH -eq "master")
{
$version = "stable"
}
else
{
$version = "unstable"
}
$File2Send = Get-ChildItem("src\SOUR.Setup\bin\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
}
# echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileMsi https://repository.scmgroup.com/repository/mconnect-raw/SOUR.msi"
# mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileMsi https://repository.scmgroup.com/repository/mconnect-raw/SOUR.msil
stages:
- build
- release
SOUR:Build:
stage: build
tags:
- win
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore "src\$env:SOL_NAME.sln"' # path alla solution corrente
- *version-fix
script:
- '& "$env:MSBUILD_PATH" "src\$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="x86" /p:OutputPath=bin/ /verbosity:minimal /m'
SOUR:Release:
stage: release
tags:
- win
only:
refs:
- develop
- main
- master
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore "src\$env:SOL_NAME.sln"' # path alla solution corrente
- *version-fix
script:
# compilo programma
- '& "$env:MSBUILD_PATH" "src\$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="x86" /p:OutputPath=bin/ /verbosity:minimal /m'
# creo installer msi
- '& "$env:MSBUILD_PATH" src\SOUR.Setup\SOUR.Setup.wixproj /p:Configuration=$env:CONFIG /p:Platform="x86" /p:ProdVersion=$env:NEW_REL /p:OutputPath=bin/ /verbosity:minimal /m'
- *hashBuild
- *nexusUpload
needs: ["SOUR:Build"]
View File