Skip to content

Commit 4a4b7e5

Browse files
committed
Work CI-CD
- Fix condition to publish github release. - Replace github release with Azure official one. ***NO_CI***
1 parent 5d60cd4 commit 4a4b7e5

File tree

1 file changed

+25
-33
lines changed

1 file changed

+25
-33
lines changed

azure-pipelines.yml

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -102,44 +102,36 @@ jobs:
102102
continueOnError: true
103103

104104
# create or update GitHub release
105-
- task: GitHubReleasePublish@1
106-
inputs:
107-
githubEndpoint: 'nanoframework'
108-
githubOwner: 'nanoframework'
109-
githubRepositoryName: $(repoName)
110-
githubTag: v$(MY_NUGET_VERSION)
111-
githubReleaseTitle: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
112-
githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from NuGet</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package: [.NET (without Reflection)](https://www.nuget.org/packages/$(nugetPackageName).NoReflection/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
113-
githubTargetCommitsh: $(Build.SourceVersion)
114-
githubReleaseDraft: false
115-
githubReleasePrerelease: true
116-
githubReuseDraftOnly: false
117-
githubReuseRelease: true
118-
githubEditRelease: true
119-
githubDeleteEmptyTag: true
120-
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
121-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
105+
- task: GithubRelease@1
106+
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
122107
displayName: Create/Update GitHub PREVIEW release
108+
inputs:
109+
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
110+
tagSource: userSpecifiedTag
111+
tag: v$(MY_NUGET_VERSION)
112+
title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
113+
releaseNotesSource: inline
114+
releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from NuGet</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package: [.NET (without Reflection)](https://www.nuget.org/packages/$(nugetPackageName).NoReflection/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
115+
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
116+
assetUploadMode: replace
117+
isPreRelease: true
118+
addChangeLog: false
123119

124120
# create or update GitHub release ON tags from release or master branches
125-
- task: GitHubReleasePublish@1
126-
inputs:
127-
githubEndpoint: 'nanoframework'
128-
githubOwner: 'nanoframework'
129-
githubRepositoryName: $(repoName)
130-
githubTag: v$(MY_NUGET_VERSION)
131-
githubReleaseTitle: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
132-
githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from NuGet</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package: [.NET (without Reflection)](https://www.nuget.org/packages/$(nugetPackageName).NoReflection/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
133-
githubTargetCommitsh: $(Build.SourceVersion)
134-
githubReleaseDraft: false
135-
githubReleasePrerelease: false
136-
githubReuseDraftOnly: false
137-
githubReuseRelease: true
138-
githubEditRelease: true
139-
githubDeleteEmptyTag: true
140-
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
121+
- task: GithubRelease@1
141122
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], 'preview') ), ne( variables['StartReleaseCandidate'], true ) )
142123
displayName: Create/Update GitHub stable release
124+
inputs:
125+
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
126+
tagSource: userSpecifiedTag
127+
tag: v$(MY_NUGET_VERSION)
128+
title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
129+
releaseNotesSource: inline
130+
releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from NuGet</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package: [.NET (without Reflection)](https://www.nuget.org/packages/$(nugetPackageName).NoReflection/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
131+
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
132+
assetUploadMode: replace
133+
isPreRelease: false
134+
addChangeLog: false
143135

144136
##############################
145137
- job: Update_Dependents

0 commit comments

Comments
 (0)