-
Notifications
You must be signed in to change notification settings - Fork 46
Replacing GitVersion 5 with 6 #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
raandree
wants to merge
40
commits into
gaelcolas:main
Choose a base branch
from
raandree:feature/gitversion6
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
81a86bf
Considering the environment variable 'ModuleVersion' if it exists
raandree 692c653
Added support for GitVersion which is a breaking change
raandree 2b8f59e
Updated launch configs
raandree 99479fa
Adapting tests to work with GitVersion 6
raandree 6299f48
Updated changelog
raandree a41082d
Change deployment mode from ContinuousDelivery to ManualDeployment
raandree 0123d68
Updated changelog
raandree 4aa295c
Fixed typo
raandree 47d551b
Merge branch 'main' into feature/gitversion6
raandree 465ac5a
Changes according to the code review
raandree df5d0d2
Added test to check for environment variable
raandree 2803e70
Merge branch 'main' into feature/gitversion6
raandree b8d2089
Merge branch 'main' into feature/gitversion6
raandree b5e990e
Fix Script Analyzer QA tests failing in various scripts (#540)
johlju 566ae41
Add mac setup instructions to README (#532)
Mynster9361 cf68ca5
Fixed issue with changelog check (#541)
Ligtorn 96ac6d8
fixing http.sslbackend schannel command because it failed
gaelcolas 771695c
updating changelog
gaelcolas ba01456
Updating ChangeLog since v0.119.0 +semver:skip (#548)
gaelcolas b611786
fixing http.sslbackend schannel command because it failed
gaelcolas 5e2beaa
Fix Gallery Preview Badge
dan-hughes a4282b1
Update PublishCodeCoverage to v2 (#552)
dan-hughes 3a4c84d
New pack task using PSResourceGet (#555)
gaelcolas d103ae2
Moved large parts of the ReadMe to the Wiki (#488)
DennisL68 14fd4c8
Updated comment based help for Resolve-Dependency.ps1 (#537)
ahpooch 1dd4128
Considering the environment variable 'ModuleVersion' if it exists
raandree 4bf20fa
Added support for GitVersion which is a breaking change
raandree 108a7c2
Updated launch configs
raandree b735a45
Adapting tests to work with GitVersion 6
raandree 0f0e234
Updated changelog
raandree 726a060
Change deployment mode from ContinuousDelivery to ManualDeployment
raandree 2964b55
Fixed typo
raandree 6482676
Changes according to the code review
raandree 7cbcc04
Added test to check for environment variable
raandree 95e5ff7
Merge branch 'feature/gitversion6' of https://github.com/raandree/Sam…
raandree 29103ae
fix: correct GitVersion 6 config for version bump regexes and feature…
raandree 3e471ce
```
raandree 75aaff7
test: add stubs for gitversion in environment variable tests
raandree 6498e50
fix: standardize formatting of RequiredModules.psd1 entries
raandree f823e38
fix(gitversion): skip AzDo pipeline variable writes when not running …
raandree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| task GitVersion -if (Get-Command -Name dotnet-gitversion.exe, gitversion.exe -ErrorAction SilentlyContinue) { | ||
|
|
||
| $command = if (Get-Command -Name gitversion.exe -ErrorAction SilentlyContinue) | ||
| { | ||
| Write-Host 'Using gitversion.exe...' | ||
| 'gitversion.exe' | ||
| } | ||
| elseif (Get-Command -Name dotnet-gitversion -ErrorAction SilentlyContinue) | ||
| { | ||
| Write-Host 'Using dotnet-gitversion...' | ||
| 'dotnet-gitversion' | ||
| } | ||
| else | ||
| { | ||
| Write-Error 'Neither gitversion.exe nor dotnet-gitversion is available.' | ||
| return | ||
| } | ||
|
|
||
| $gitVersionObject = & $command | ||
| Write-Host -------------- GitVersion Outout -------------- | ||
| $gitVersionObject | Write-Host | ||
| Write-Host ----------------------------------------------- | ||
|
|
||
| $gitVersionObject = $gitVersionObject | ConvertFrom-Json | ||
| $longestKeyLength = ($gitVersionObject | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | Sort-Object { $_.Length } | Select-Object -Last 1).Length | ||
| $gitVersionObject.PSObject.Properties.ForEach{ | ||
| Write-Host -Object ("Setting Task Variable {0,-$longestKeyLength} with value '{1}'." -f $_.Name, $_.Value) | ||
| } | ||
|
|
||
| $isPreRelease = [bool]$gitVersionObject.PreReleaseLabel | ||
| $versionElements = $gitVersionObject.MajorMinorPatch | ||
|
|
||
| if ($isPreRelease) | ||
| { | ||
| if ($gitVersionObject.BranchName -eq 'main') | ||
| { | ||
| $nextPreReleaseNumber = $gitVersionObject.PreReleaseNumber | ||
| $paddedNextPreReleaseNumber = '{0:D4}' -f $nextPreReleaseNumber | ||
|
|
||
| $versionElements += $gitVersionObject.PreReleaseLabelWithDash | ||
| $versionElements += $paddedNextPreReleaseNumber | ||
| } | ||
| else | ||
| { | ||
| $versionElements += $gitVersionObject.PreReleaseLabelWithDash | ||
| $versionElements += '.' + $gitVersionObject.CommitsSinceVersionSource | ||
| } | ||
| } | ||
|
|
||
| $versionString = -join $versionElements | ||
| [System.Environment]::SetEnvironmentVariable('ModuleVersion', $versionString, 'Process') | ||
|
|
||
| Write-Host "Writing version string '$versionString' to build / environment variable 'VersionString'." | ||
| Write-Host "##vso[task.setvariable variable=VersionString;]$($versionString)" | ||
|
|
||
| Write-Host "Updating build number to '$versionString'." | ||
| Write-Host "##vso[build.updatebuildnumber]$($versionString)" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,26 @@ | ||
| mode: ContinuousDelivery | ||
| next-version: 0.90 | ||
| mode: ManualDeployment | ||
| next-version: 0.90.0 | ||
| major-version-bump-message: '\s?(breaking|major|breaking\schange)' | ||
| minor-version-bump-message: '(adds?|features?|minor)\b' | ||
| patch-version-bump-message: '\s?(fix|patch)' | ||
| no-bump-message: '\+semver:\s?(none|skip)' | ||
| assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}' | ||
| branches: | ||
| master: | ||
| tag: preview | ||
| regex: ^main$ | ||
| main: | ||
| label: preview | ||
| regex: ^master$|^main$ | ||
| pull-request: | ||
| tag: PR | ||
| label: PR | ||
| feature: | ||
| tag: useBranchName | ||
| label: '{BranchName}' | ||
| increment: Minor | ||
| regex: f(eature(s)?)?[\/-] | ||
| source-branches: ['master'] | ||
| source-branches: ['main'] | ||
| hotfix: | ||
| tag: fix | ||
| label: fix | ||
| increment: Patch | ||
| regex: (hot)?fix(es)?[\/-] | ||
| source-branches: ['master'] | ||
| source-branches: ['main'] | ||
|
|
||
| ignore: | ||
| sha: [] | ||
| merge-message-formats: {} | ||
|
|
||
|
|
||
| # feature: | ||
| # tag: useBranchName | ||
| # increment: Minor | ||
| # regex: f(eature(s)?)?[/-] | ||
| # source-branches: ['master'] | ||
| # hotfix: | ||
| # tag: fix | ||
| # increment: Patch | ||
| # regex: (hot)?fix(es)?[/-] | ||
| # source-branches: ['master'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.