|
1 | 1 | trigger: |
2 | 2 | branches: |
3 | | - include: [main, develop, "release-*" ] |
| 3 | + include: |
| 4 | + - main |
| 5 | + - develop |
| 6 | + - release-* |
| 7 | + - refs/tags/* |
4 | 8 | paths: |
5 | | - exclude: [README.md, LICENSE.md, NuGet.Config, .github_changelog_generator, .gitignore] |
| 9 | + exclude: |
| 10 | + - .gitignore |
| 11 | + - LICENSE.md |
| 12 | + - README.md |
| 13 | + - NuGet.Config |
| 14 | + |
6 | 15 | tags: |
7 | | - include: ["v*"] |
| 16 | + include: |
| 17 | + - v* |
8 | 18 |
|
9 | 19 | # PR always trigger build |
10 | 20 | pr: |
|
23 | 33 | ############################## |
24 | 34 | - job: Get_Build_Flags |
25 | 35 | pool: |
26 | | - vmImage: 'windows-2019' |
| 36 | + vmImage: 'windows-latest' |
27 | 37 |
|
28 | 38 | steps: |
29 | 39 | - checkout: self |
|
75 | 85 | - Get_Build_Flags |
76 | 86 |
|
77 | 87 | pool: |
78 | | - vmImage: 'windows-2019' |
| 88 | + vmImage: 'windows-latest' |
79 | 89 |
|
80 | 90 | variables: |
81 | 91 | DOTNET_NOLOGO: true |
@@ -234,35 +244,46 @@ jobs: |
234 | 244 | packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' |
235 | 245 | publishFeedCredentials: 'NuGet-$(System.TeamProject)' |
236 | 246 |
|
237 | | - # # create or update GitHub release |
238 | | - # - task: GitHubReleasePublish@1 |
239 | | - # inputs: |
240 | | - # githubEndpoint: 'nanoFramework' |
241 | | - # githubOwner: 'nanoframework' |
242 | | - # githubRepositoryName: 'nanoFramework.TestPlatform' |
243 | | - # githubTag: v$(GitBuildVersionSimple) |
244 | | - # githubReleaseTitle: '.NET nanoFramework Unit Test Framework v$(GitBuildVersionSimple)' |
245 | | - # githubReleaseNotes: 'add description here' |
246 | | - # githubTargetCommitsh: $(Build.SourceVersion) |
247 | | - # githubReleaseDraft: true |
248 | | - # githubReleasePrerelease: false |
249 | | - # githubReuseDraftOnly: false |
250 | | - # githubReuseRelease: false |
251 | | - # githubEditRelease: true |
252 | | - # githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg' |
253 | | - # condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) |
254 | | - # displayName: Create/Update GitHub release |
| 247 | + # create or update GitHub release ON tags from release or main branches |
| 248 | + - task: GithubRelease@1 |
| 249 | + condition: >- |
| 250 | + and( |
| 251 | + succeeded(), |
| 252 | + eq(variables['System.PullRequest.PullRequestId'], ''), |
| 253 | + not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')), |
| 254 | + eq(variables['StartReleaseCandidate'], false) |
| 255 | + ) |
| 256 | + displayName: Create/Update GitHub stable release |
| 257 | + inputs: |
| 258 | + action: edit |
| 259 | + gitHubConnection: 'github.com_nano-$(System.TeamProject)' |
| 260 | + tagSource: userSpecifiedTag |
| 261 | + tag: v$(GitBuildVersionSimple) |
| 262 | + title: '.NET nanoFramework Unit Test Framework v$(GitBuildVersionSimple)' |
| 263 | + releaseNotesSource: inline |
| 264 | + releaseNotesInline: '' |
| 265 | + assets: '$(Build.ArtifactStagingDirectory)/*.nupkg' |
| 266 | + assetUploadMode: replace |
| 267 | + isPreRelease: false |
| 268 | + addChangeLog: true |
255 | 269 |
|
256 | 270 | ############################## |
257 | 271 | - job: Update_Dependents |
258 | | - condition: and( or( eq(dependencies.Get_Build_Flags.outputs['GetPRLabels.RUN_UPDATE_DEPENDENTS'], 'true'), eq(variables['UPDATE_DEPENDENTS'], 'true') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) |
| 272 | + condition: >- |
| 273 | + and( |
| 274 | + or( |
| 275 | + eq(dependencies.Get_Build_Flags.outputs['GetPRLabels.RUN_UPDATE_DEPENDENTS'], 'true'), |
| 276 | + eq(variables['UPDATE_DEPENDENTS'], 'true') |
| 277 | + ), |
| 278 | + not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) |
| 279 | + ) |
259 | 280 |
|
260 | 281 | dependsOn: |
261 | 282 | - Get_Build_Flags |
262 | 283 | - Build_Test_Framework |
263 | 284 |
|
264 | 285 | pool: |
265 | | - vmImage: 'windows-2019' |
| 286 | + vmImage: 'windows-latest' |
266 | 287 |
|
267 | 288 | steps: |
268 | 289 | # need this here in order to persist GitHub credentials |
@@ -294,7 +315,7 @@ jobs: |
294 | 315 | condition: failed('Build_Test_Framework') |
295 | 316 |
|
296 | 317 | pool: |
297 | | - vmImage: 'windows-2019' |
| 318 | + vmImage: 'windows-latest' |
298 | 319 |
|
299 | 320 | steps: |
300 | 321 |
|
|
0 commit comments