File tree Expand file tree Collapse file tree 5 files changed +41
-6
lines changed
Snyk.VisualStudio.Extension.2022/Download Expand file tree Collapse file tree 5 files changed +41
-6
lines changed Original file line number Diff line number Diff line change 99Param (
1010 [Parameter (Mandatory = $true )]
1111 [ValidateSet (" semver" , " time" )]
12- [string ]$VersionType # Parameter to choose the versioning method: "semver" or "time"
12+ [string ]$VersionType , # Parameter to choose the versioning method: "semver" or "time"
13+
14+ [Parameter (Mandatory = $false )]
15+ [ValidateSet (" incrementPatch" , " incrementMinor" , " incrementMajor" )]
16+ [string ]$BumpType = " incrementPatch" # Parameter to choose the bump type for semver mode
1317)
1418
1519if ($VersionType -eq " semver" ) {
@@ -36,8 +40,24 @@ if ($VersionType -eq "semver") {
3640 Write-Verbose " MINOR part: $Minor "
3741 Write-Verbose " PATCH part: $Patch "
3842
39- # Hardcoded increment for patch
40- $Patch += 1
43+ switch ($BumpType ) {
44+ " incrementMajor" {
45+ $Major += 1
46+ $Minor = 0
47+ $Patch = 0
48+ }
49+ " incrementMinor" {
50+ $Minor += 1
51+ $Patch = 0
52+ }
53+ " incrementPatch" {
54+ $Patch += 1
55+ }
56+ default {
57+ Write-Error " Invalid bump type specified: $BumpType "
58+ exit 1
59+ }
60+ }
4161
4262 $NextSemverTag = " $Major .$Minor .$Patch "
4363 Write-Host " Next SemVer tag: $NextSemverTag "
Original file line number Diff line number Diff line change 99 channel :
1010 type : string
1111 default : preview
12+ incrementLevel :
13+ description : ' Version level to increment'
14+ type : string
15+ default : incrementPatch
1216 outputs :
1317 version :
1418 description : ' next Git tag in semver format'
3236 id : vsix_version
3337 run : |
3438 if ("${{ inputs.channel}}" -eq "stable") {
35- & ".\.github\actions\next-git-tag\next-git-tag.ps1" semver
39+ & ".\.github\actions\next-git-tag\next-git-tag.ps1" semver "${{ inputs.incrementLevel }}"
3640 }
3741 elseif ("${{ inputs.channel }}" -eq "preview") {
3842 & ".\.github\actions\next-git-tag\next-git-tag.ps1" time
Original file line number Diff line number Diff line change 1515 with :
1616 solution-file-path : .
1717 channel : preview
18+ incrementLevel : incrementPatch
1819 secrets : inherit
1920 run-integration-tests :
2021 needs : build-project
Original file line number Diff line number Diff line change @@ -2,7 +2,16 @@ name: Release Extension
22
33on :
44 workflow_dispatch :
5-
5+ inputs :
6+ incrementLevel :
7+ description : ' Version level to increment'
8+ required : true
9+ type : choice
10+ options :
11+ - incrementPatch
12+ - incrementMinor
13+ - incrementMajor
14+ default : incrementPatch
615env :
716 SOLUTION_FILE_PATH : .
817 DEFAULT_BRANCH : main
1322 with :
1423 solution-file-path : .
1524 channel : stable
25+ incrementLevel : ${{ inputs.incrementLevel }}
1626 secrets : inherit
1727 run-integration-tests :
1828 needs : build-project
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ namespace Snyk.VisualStudio.Extension.Download
1818 public class SnykCliDownloader
1919 {
2020 public const string DefaultBaseDownloadUrl = "https://downloads.snyk.io" ;
21- public const string DefaultReleaseChannel = "preview " ;
21+ public const string DefaultReleaseChannel = "stable " ;
2222
2323 private const string LatestReleaseVersionUrlScheme = "{0}/cli/{1}/ls-protocol-version-" + LsConstants . ProtocolVersion ;
2424 private const string LatestReleaseDownloadUrlScheme = "{0}/cli/{1}/" + SnykCli . CliFileName ;
You can’t perform that action at this time.
0 commit comments