Skip to content

Commit

Permalink
Updatarouny
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh committed Jun 18, 2024
1 parent 404bfa4 commit 2e8d882
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
9 changes: 8 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -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: {}
27 changes: 25 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand All @@ -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
Expand All @@ -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 "--------------"
Expand All @@ -46,6 +59,7 @@ $dotnetversion = where dotnet | dotnet --version
dotnet restore
dotnet build
dotnet test
Write-Output "--------------"

Write-Output "Zip ABBWorkItemClone"
Write-Output "--------------"
Expand All @@ -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"
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"
}

0 comments on commit 2e8d882

Please sign in to comment.