Skip to content

Commit

Permalink
fixing GitHub release
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jun 9, 2019
1 parent 8695396 commit 2cfed95
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 82 deletions.
79 changes: 0 additions & 79 deletions Source/build/archive/azure-pipelines.yml

This file was deleted.

47 changes: 44 additions & 3 deletions Source/build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,48 @@ stages:
runOnce:
deploy:
steps:
- powershell: ./Process-Release.ps1
- powershell: |
try {
$artifactDirectory = $env:searchDirectory
Write-Host "Currect working directory - $artifactDirectory"
$nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1
if($null -eq $nupkg)
{
Throw "No NuGet Package could be found in the current directory"
}
Write-Host "Package Name $($nupkg.Name)"
$nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$'
$VersionName = $Matches[2]
$IsPreview = $VersionName -match '-pre$'
$ReleaseDisplayName = $VersionName
if($null -eq $env:IS_PREVIEW)
{
Write-Output ("##vso[task.setvariable variable=IS_PREVIEW;]$IsPreview")
}
if($true -eq $IsPreview)
{
$baseVersion = $VersionName.Split('-')[0]
$ReleaseDisplayName = "$baseVersion - Preview"
}
Write-Host "Version Name - $VersionName"
Write-Host "Release Display Name - $ReleaseDisplayName"
Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName")
Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName")
}
catch {
Write-Error $_
exit 1
}
displayName: Process Artifacts for Release
workingDirectory: $(System.DefaultWorkingDirectory)/Source/build
env:
searchDirectory: $(Pipeline.Workspace)/NuGet
- task: ArchiveFiles@2
displayName: 'Archive Assembly Artifacts'
Expand All @@ -96,19 +135,21 @@ stages:
- task: GithubRelease@0
displayName: 'Create GitHub Release'
inputs:
githubConnection: 'Prism GitHub Connection'
gitHubConnection: 'Prism GitHub Connection'
title: '$(ReleaseDisplayName)'
tagSource: manual
tag: 'v$(VersionName)'
isPreRelease: $(IS_PREVIEW)
assets: |
$(DLLArtifactsZip)
$(Pipeline.Workspace)/**/*.nupkg
isDraft: true
addChangeLog: true

- task: NuGetCommand@2
displayName: NuGet Push
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;$(Pipeline.Workspace)/**/*.symbols.nupkg'
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;!$(Pipeline.Workspace)/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet.org'

0 comments on commit 2cfed95

Please sign in to comment.