Skip to content

Commit

Permalink
adding deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Nov 7, 2023
1 parent f40b793 commit c0c8330
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Deploy.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Script for deploying module via github actions
# If -Version is not specified, it will use the output from gitversion
# and remove the build number and add 1 to the revision number
# If -Version is not specified, it will use the output from gitversion MajorMinorPatch
# which is from the latest tag
#
param(
[parameter(Mandatory = $false)]
[String]
Expand All @@ -10,9 +11,16 @@ param(
$ModuleName = "F7History"
if ($null -eq $Version -or "" -eq $Version) {
$prevVersion = dotnet-gitversion /showvariable MajorMinorPatch
$build = dotnet-gitversion /showvariable BuildMetaData
"Got build from dotnet-gitversion: $build"
$Version = "$($prevVersion).$($build)"
$Version = "v$($prevVersion)"
"Got version from dotnet-gitversion: $Version"
} else {
# If no 'v` was prefixed, add it
if ($Version -notmatch "^v") {
$Version = "v$($Version)"
}
"Adding tag: $Version"
git tag $Version
}

# Push the tag to origin using atomic
git push --atomic origin main $Version

0 comments on commit c0c8330

Please sign in to comment.