Skip to content

Commit 10c984f

Browse files
committed
Work CI-CD
- Add task to publish github releases. - Rework yaml style. - Move VM image to windows-latest. ***NO_CI***
1 parent 485f7e1 commit 10c984f

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

azure-pipelines.yml

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
trigger:
22
branches:
3-
include: [main, develop, "release-*" ]
3+
include:
4+
- main
5+
- develop
6+
- release-*
7+
- refs/tags/*
48
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+
615
tags:
7-
include: ["v*"]
16+
include:
17+
- v*
818

919
# PR always trigger build
1020
pr:
@@ -23,7 +33,7 @@ jobs:
2333
##############################
2434
- job: Get_Build_Flags
2535
pool:
26-
vmImage: 'windows-2019'
36+
vmImage: 'windows-latest'
2737

2838
steps:
2939
- checkout: self
@@ -75,7 +85,7 @@ jobs:
7585
- Get_Build_Flags
7686

7787
pool:
78-
vmImage: 'windows-2019'
88+
vmImage: 'windows-latest'
7989

8090
variables:
8191
DOTNET_NOLOGO: true
@@ -234,35 +244,46 @@ jobs:
234244
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
235245
publishFeedCredentials: 'NuGet-$(System.TeamProject)'
236246

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
255269

256270
##############################
257271
- 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+
)
259280
260281
dependsOn:
261282
- Get_Build_Flags
262283
- Build_Test_Framework
263284

264285
pool:
265-
vmImage: 'windows-2019'
286+
vmImage: 'windows-latest'
266287

267288
steps:
268289
# need this here in order to persist GitHub credentials
@@ -294,7 +315,7 @@ jobs:
294315
condition: failed('Build_Test_Framework')
295316

296317
pool:
297-
vmImage: 'windows-2019'
318+
vmImage: 'windows-latest'
298319

299320
steps:
300321

0 commit comments

Comments
 (0)