From 2e8d8823e2c05cae1d33b6dc8f07684564ba93b4 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Tue, 18 Jun 2024 12:29:07 +0100 Subject: [PATCH] Updatarouny --- GitVersion.yml | 9 ++++++++- build.ps1 | 27 +++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 85cfd27..ee987f2 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,6 +1,13 @@ assembly-versioning-scheme: MajorMinorPatchTag mode: ContinuousDelivery -branches: {} +next-version: 0.2.0 +branches: + main: + mode: ContinuousDeployment + tag: 'preview' + increment: Patch + regex: ^master$|^main$ + ignore: sha: [] merge-message-formats: {} diff --git a/build.ps1 b/build.ps1 index 7502693..564edda 100644 --- a/build.ps1 +++ b/build.ps1 @@ -3,7 +3,7 @@ Write-Output "======================" Write-Output "Running from $($MyInvocation.MyCommand.Path)" -Write-Output "INSTALL APPS" +Write-Output "INSTALL CHOCO APPS" Write-Output "------------" # Install Choco Apps # Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) @@ -20,10 +20,21 @@ if (($installedStuff -like "*GitVersion.Portable*").Count -eq 0) { Write-Output "Installing GitVersion" choco install gitversion.portable --confirm --accept-license -y } else { Write-Output "Detected GitVersion"} +Write-Output "------------" # Install DotNetApps +Write-Output "INSTALL DotNetApps APPS" +Write-Output "------------" +$installedDotNetStuff = dotnet tool list -g +if (($installedDotNetStuff -like "*GitVersion.Tool*").Count -eq 0) { + Write-Output "Installing GitVersion.Tool" + choco install 7zip --confirm --accept-license -y + } else { Write-Output "Detected GitVersion.Tool"} dotnet tool install --global GitVersion.Tool +Write-Output "------------" +Write-Output "REFRESH ENVIRONMENT" +Write-Output "------------" # Refresh environment $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") # Make `refreshenv` available right away, by defining the $env:ChocolateyInstall @@ -32,12 +43,14 @@ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" Update-SessionEnvironment +Write-Output "------------" Write-Output "Detect Version" Write-Output "--------------" # Get Version Numbers $versionInfo = dotnet-gitversion | ConvertFrom-Json Write-Output "Version: $($versionInfo.SemVer)" +Write-Output "--------------" Write-Output "Complile and Test" Write-Output "--------------" @@ -46,6 +59,7 @@ $dotnetversion = where dotnet | dotnet --version dotnet restore dotnet build dotnet test +Write-Output "--------------" Write-Output "Zip ABBWorkItemClone" Write-Output "--------------" @@ -65,6 +79,15 @@ if (Get-Item -Path ".\output" -ErrorAction SilentlyContinue) { New-Item -Name "output" -ItemType Directory 7z a -tzip $ZipFilePath ".\ABB.WorkItemClone.ConsoleUI\bin\Debug\net8.0\**" +Write-Output "--------------" # Publish -#gh release create $versionText .\output\$ZipName --generate-notes --generate-notes --prerelease --discussion-category "General" \ No newline at end of file +Write-Output "PUBLISH ABBWorkItemClone" +Write-Output "--------------" +if ($versionInfo.PreReleaseTag -eq "") { + Write-Output "Publishing Release" + gh release create $versionText .\output\$ZipName --generate-notes --generate-notes --discussion-category "General" +} else { + Write-Output "Publishing PreRelease" + gh release create $versionText .\output\$ZipName --generate-notes --generate-notes --prerelease --discussion-category "General" +} \ No newline at end of file