diff --git a/Build/deploy.psdeploy.ps1 b/Build/deploy.psdeploy.ps1 index 99ea970..a806e02 100644 --- a/Build/deploy.psdeploy.ps1 +++ b/Build/deploy.psdeploy.ps1 @@ -35,20 +35,25 @@ if( } } - $GitHubUser = 'nicholasdille' - $GitHubRepository = 'PowerShell-Statistics' - $NoDraft = $true - $Release = $true - $RequestBody = @{ - "tag_name" = "$Version" - "target_commitish" = "$Branch" - "name" = "Version $Version" - "body" = "$Description" - "draft" = -Not $NoDraft - "prerelease" = -Not $Release - } | ConvertTo-Json - $Result = Invoke-WebRequest -Method Post -Uri "https://api.github.com/repos/$GitHubUser/$GitHubRepository/releases" -Headers @{Authorization = "token $ENV:GitHubToken"} -Body $RequestBody - $Result + if (Test-Path -Path "$ProjectRoot\ModuleVersion.txt") { + $GitHubUser = 'nicholasdille' + $GitHubRepository = 'PowerShell-Statistics' + $GitHubBranch = 'master' + $Version = Get-Content -Path "$ProjectRoot\ModuleVersion.txt" + $Description = '' + $NoDraft = $true + $Release = $true + $RequestBody = @{ + "tag_name" = "$Version" + "target_commitish" = "$GitHubBranch" + "name" = "Version $Version" + "body" = "$Description" + "draft" = -Not $NoDraft + "prerelease" = -Not $Release + } | ConvertTo-Json + $Result = Invoke-WebRequest -Method Post -Uri "https://api.github.com/repos/$GitHubUser/$GitHubRepository/releases" -Headers @{Authorization = "token $ENV:GitHubToken"} -Body $RequestBody + $Result + } } else { diff --git a/Build/psake.ps1 b/Build/psake.ps1 index 8fcb5a5..643ec9c 100644 --- a/Build/psake.ps1 +++ b/Build/psake.ps1 @@ -80,9 +80,13 @@ Task Build -Depends Test,Docs { $scriptBlock.CheckRestrictedLanguage($allowedCommands, $allowedVariables, $true) $manifest = & $scriptBlock + $ModuleVersion = $manifest.ModuleVersion If($ENV:BHBuildSystem -eq 'AppVeyor') { - Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ModuleVersion -Value "$($manifest.ModuleVersion).$env:APPVEYOR_BUILD_NUMBER" -ErrorAction stop + Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ModuleVersion -Value "$ModuleVersion.$env:APPVEYOR_BUILD_NUMBER" -ErrorAction stop + $ModuleVersion = "$ModuleVersion.$env:APPVEYOR_BUILD_NUMBER" } + + Set-Content -Path "$ProjectRoot\ModuleVersion.txt" -Value $ModuleVersion } Task Deploy -Depends Build { diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 600e50d..d5cdb41 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,4 @@ -# 1.1.60 +# 1.1.61 - Improved check for data via parameter or pipeline - Added automatic creation of GitHub release