Skip to content

Commit c083edd

Browse files
committed
Added more variables !deploy
1 parent e02af35 commit c083edd

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

Build/deploy.psdeploy.ps1

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,25 @@ if(
3535
}
3636
}
3737

38-
$GitHubUser = 'nicholasdille'
39-
$GitHubRepository = 'PowerShell-Statistics'
40-
$NoDraft = $true
41-
$Release = $true
42-
$RequestBody = @{
43-
"tag_name" = "$Version"
44-
"target_commitish" = "$Branch"
45-
"name" = "Version $Version"
46-
"body" = "$Description"
47-
"draft" = -Not $NoDraft
48-
"prerelease" = -Not $Release
49-
} | ConvertTo-Json
50-
$Result = Invoke-WebRequest -Method Post -Uri "https://api.github.com/repos/$GitHubUser/$GitHubRepository/releases" -Headers @{Authorization = "token $ENV:GitHubToken"} -Body $RequestBody
51-
$Result
38+
if (Test-Path -Path "$ProjectRoot\ModuleVersion.txt") {
39+
$GitHubUser = 'nicholasdille'
40+
$GitHubRepository = 'PowerShell-Statistics'
41+
$GitHubBranch = 'master'
42+
$Version = Get-Content -Path "$ProjectRoot\ModuleVersion.txt"
43+
$Description = ''
44+
$NoDraft = $true
45+
$Release = $true
46+
$RequestBody = @{
47+
"tag_name" = "$Version"
48+
"target_commitish" = "$GitHubBranch"
49+
"name" = "Version $Version"
50+
"body" = "$Description"
51+
"draft" = -Not $NoDraft
52+
"prerelease" = -Not $Release
53+
} | ConvertTo-Json
54+
$Result = Invoke-WebRequest -Method Post -Uri "https://api.github.com/repos/$GitHubUser/$GitHubRepository/releases" -Headers @{Authorization = "token $ENV:GitHubToken"} -Body $RequestBody
55+
$Result
56+
}
5257
}
5358
else
5459
{

Build/psake.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,13 @@ Task Build -Depends Test,Docs {
8080
$scriptBlock.CheckRestrictedLanguage($allowedCommands, $allowedVariables, $true)
8181
$manifest = & $scriptBlock
8282

83+
$ModuleVersion = $manifest.ModuleVersion
8384
If($ENV:BHBuildSystem -eq 'AppVeyor') {
84-
Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ModuleVersion -Value "$($manifest.ModuleVersion).$env:APPVEYOR_BUILD_NUMBER" -ErrorAction stop
85+
Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ModuleVersion -Value "$ModuleVersion.$env:APPVEYOR_BUILD_NUMBER" -ErrorAction stop
86+
$ModuleVersion = "$ModuleVersion.$env:APPVEYOR_BUILD_NUMBER"
8587
}
88+
89+
Set-Content -Path "$ProjectRoot\ModuleVersion.txt" -Value $ModuleVersion
8690
}
8791

8892
Task Deploy -Depends Build {

RELEASENOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 1.1.60
1+
# 1.1.61
22

33
- Improved check for data via parameter or pipeline
44
- Added automatic creation of GitHub release

0 commit comments

Comments
 (0)