Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eriqua committed Sep 21, 2023
1 parent b033a40 commit c1ae0b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ function Publish-ModuleFromPathToPBR {
'--force'
)
# bicep publish @publishInput
}
# TODO move to its own task to show that as skipped if no file qualifies for new version
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function Get-ModuleTargetPatchVersion {
[string] $MajMinVersion
)

# TODO test .10 patch version and sort
$ModuleRelativeFolderPath = $ModuleRelativeFolderPath -replace '\\', '/'

# 1. Get all released module tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Get-ModuleTargetVersion {

# 2. Get MAJOR and MINOR from [version.json]
$versionFileTargetVersion = (Get-Content $VersionFilePath | ConvertFrom-Json).version
$major, $minor = $versionFileTargetVersion -split '\.', 2
$major, $minor = $versionFileTargetVersion -split '\.'

# 3. Get PATCH
# Check if [version.json] file version property was updated (compare with previous head)
Expand All @@ -50,7 +50,7 @@ function Get-ModuleTargetVersion {
else {
# Otherwise calculate the patch version
Write-Verbose "[version.json] file version property was not updated. Calculating new PATCH version." -Verbose
$patch = Get-ModuleTargetPatchVersion -ModuleFolderPath $ModuleFolderPath -MajMinVersion '$major.$minor'
$patch = Get-ModuleTargetPatchVersion -ModuleFolderPath $ModuleFolderPath -MajMinVersion "$major.$minor"
}

# 4. Get full Semver as MAJOR.MINOR.PATCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ function New-ModuleReleaseTag {
$wellFormattedTag = git check-ref-format --normalize $tagName
if (-not $wellFormattedTag) {
Write-Verbose "Tag [$tagName] is not well formatted" -Verbose
# TODO what if tag not formatted correctly
# TODO exception if tag not formatted correctly
}

# 3 Check tag already existing, if so return
$existingTag = git ls-remote --tags origin $tagName
if ($existingTag) {
Write-Verbose "Tag [$tagName] already exists" -Verbose
# TODO what if tag already existing
# TODO exception if tag already existing
}

# 3 Create and push tag
git tag $tagName
git push origin $tagName

# 4 Return
# 4 Return tag
return $tagName
}

0 comments on commit c1ae0b2

Please sign in to comment.