6565 msbuildArgs : ' /p:PublicRelease=true'
6666 configuration : ' $(buildConfiguration)'
6767
68+ - powershell : |
69+ # get subject and commit message for commit
70+ $commitMessage = git log --format='%B' -1
71+
72+ # need to flatten message by removing new lines
73+ $commitMessage = $commitMessage -replace "`r`n", " "
74+
75+ if($commitMessage -like "*PUBLISH_RELEASE*")
76+ {
77+ # set variable
78+ Write-Host "$("##vso[task.setvariable variable=RELEASE_DRAFT;isOutput=true]")False"
79+ Write-Host "$("##vso[task.setvariable variable=RELEASE_VERSION;isOutput=true]")True"
80+ Write-Host "Release draft: FALSE"
81+ }
82+ else
83+ {
84+ # set variable
85+ Write-Host "$("##vso[task.setvariable variable=RELEASE_DRAFT;isOutput=true]")True"
86+ Write-Host "$("##vso[task.setvariable variable=RELEASE_VERSION;isOutput=true]")False"
87+ Write-Host "Release draft: TRUE"
88+ }
89+ name: SetReleaseDraftVar
90+ condition: not(variables['StartReleaseCandidate'])
91+ displayName: Set release draft var
92+
6893 - task : CopyFiles@1
6994 inputs :
7095 sourceFolder : $(Build.SourcesDirectory)
@@ -109,15 +134,15 @@ jobs:
109134 condition : and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
110135 displayName : Publish deployables artifacts
111136
112- # push NuGet packages to MyGet feed (always happens except on PR builds)
137+ # push NuGet packages to Azure Artifacts feed (always happens except on PR builds)
113138 - task : NuGetCommand@2
114139 inputs :
115140 command : push
116141 nuGetFeedType : external
117142 packagesToPush : ' $(Build.ArtifactStagingDirectory)/*.nupkg'
118- publishFeedCredentials : ' MyGet '
143+ publishFeedCredentials : ' AzureArtifacts '
119144 condition : succeeded()
120- displayName : Push NuGet packages to MyGet
145+ displayName : Push NuGet packages to Azure Artifacts
121146
122147 # create or update GitHub release
123148 - task : GitHubReleasePublish@1
@@ -129,7 +154,7 @@ jobs:
129154 githubReleaseTitle : ' nanoFramework Metadata Processor v$(GitBuildVersionSimple)'
130155 githubReleaseNotes : ' add description here'
131156 githubTargetCommitsh : $(Build.SourceVersion)
132- githubReleaseDraft : true
157+ githubReleaseDraft : $(RELEASE_DRAFT)
133158 githubReleasePrerelease : false
134159 githubReuseDraftOnly : true
135160 githubReuseRelease : true
0 commit comments