Skip to content

Commit

Permalink
Fixed upload of release asset !deploy !release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Jun 21, 2017
1 parent 6799ca7 commit 3a0ec1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Build/deploy.psdeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ if (
$env:BHCommitMessage -match '!release'
)
{
Compress-Archive -Path $env:BHModulePath -DestinationPath $env:BHProjectPath\$env:ModuleName-$env:ModuleVersion.zip
if (-Not (Test-Path -Path $env:BHProjectPath\$env:ModuleName-$env:ModuleVersion.zip)) {
$ReleaseAsset = "$env:BHProjectPath\$env:ModuleName-$env:ModuleVersion.zip"
Compress-Archive -Path $env:BHModulePath -DestinationPath $ReleaseAsset
if (-Not (Test-Path -Path $ReleaseAsset)) {
Write-Error 'Failed to create archive for release'
}
"Created release asset $env:BHProjectPath\$env:ModuleName-$env:ModuleVersion.zip" |
"Created release asset $ReleaseAsset" |
Write-Host

$ReleaseNotes = 'PLEASE FILL MANUALLY'
Expand Down Expand Up @@ -92,7 +93,7 @@ if (

"Uploading asset to GitHub release" |
Write-Host
$RequestBody = Get-Content -Path $env:BHProjectPath\$env:BHProjectName-$env:ModuleVersion.zip -Raw
$RequestBody = Get-Content -Path $ReleaseAsset -Raw
$Result = Invoke-WebRequest -Method Post -Uri "https://uploads.github.com/repos/$ENV:APPVEYOR_REPO_NAME/releases/$GitHubReleaseId/assets?name=$env:BHProjectName-$env:ModuleVersion.zip" -Headers @{Authorization = "token $ENV:GitHubToken"} -ContentType 'application/zip' -Body $RequestBody
if ($Result.StatusCode -ne 201) {
Write-Error "Failed to upload release asset. Code $($Result.StatusCode): $($Result.Content)"
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.112
# 1.1.113

- Integrated updated scripts from PowerShell-CI
- Fixed test for property
Expand Down

0 comments on commit 3a0ec1c

Please sign in to comment.