Skip to content

Commit

Permalink
Added more variables !deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Jun 6, 2017
1 parent e02af35 commit c083edd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
33 changes: 19 additions & 14 deletions Build/deploy.psdeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 5 additions & 1 deletion Build/psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1.1.60
# 1.1.61

- Improved check for data via parameter or pipeline
- Added automatic creation of GitHub release
Expand Down

0 comments on commit c083edd

Please sign in to comment.