Skip to content

Commit

Permalink
fixing bug when no project nupkg to release to GitHub release artifac…
Browse files Browse the repository at this point in the history
…ts. i.e. in a DscPipeline
  • Loading branch information
gaelcolas committed Jan 25, 2022
1 parent bbb3a7f commit 45f1e8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .build/tasks/New-Release.GitHub.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ task Publish_release_to_GitHub -if ($GitHubToken -and (Get-Module -Name PowerShe
Write-Build DarkGray "Creating new GitHub release '$ReleaseTag ' at '$remoteURL'."
$APIResponse = New-GitHubRelease @releaseParams
Write-Build Green "Release Created. Adding Assets..."
if (Test-Path -Path $PackageToRelease)
if ((-not [string]::IsNullOrEmpty($PackageToRelease)) -and (Test-Path -Path $PackageToRelease))
{
$APIResponse | New-GitHubReleaseAsset -Path $PackageToRelease -AccessToken $GitHubToken
Write-Build Green "Asset '$PackageToRelease' added."
}
else
{
Write-Build DarkGray 'No Module nupkg found for this release.'
}

if ($ReleaseAssets = $BuildInfo.GitHubConfig.ReleaseAssets)
{
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed task error when the PackageToRelease does not exist (i.e. it's not a module being built creating the .nupkg).
- Fixed typo when adding debug output for GH task.
- Fixed using the `Set-SamplerTaskVariable` in GH tasks.
- Fixed the Azure DevOps pipeline to build on Ubunt latest.

0 comments on commit 45f1e8a

Please sign in to comment.