Skip to content

Commit 2ef6e1f

Browse files
committed
Work CI-CD
- Add tasks to pack Syslog nuget. - Add stream and syslog packages to releases readme. - Rework yaml layout. - Remove unnecessary push tasks. - Remove CONTRIBUTING doc (available from org template repo).
1 parent 7210978 commit 2ef6e1f

File tree

2 files changed

+32
-38
lines changed

2 files changed

+32
-38
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
trigger:
22
branches:
3-
include: [main, develop, "release-*" ]
3+
include:
4+
- main
5+
- develop
6+
- release-*
47
paths:
5-
exclude: [README.md, LICENSE.md, NuGet.Config, .github_changelog_generator, .gitignore]
8+
exclude:
9+
- .github_changelog_generator
10+
- .gitignore
11+
- CHANGELOG.md
12+
- CODE_OF_CONDUCT.md
13+
- LICENSE.md
14+
- NuGet.Config
15+
- README.md
616
tags:
717
include: ["v*"]
818

@@ -51,64 +61,51 @@ steps:
5161
parameters:
5262
nugetPackageName: 'nanoFramework.Logging.Stream'
5363

54-
- template: azure-pipelines-templates/class-lib-publish.yml@templates
55-
56-
# need to push remaining packages to NuGet individually because the template above can only push one package (happens on tag builds for any branch)
57-
- task: NuGetCommand@2
58-
condition: and( succeeded(), ne( variables['StartReleaseCandidate'], true ) )
59-
continueOnError: true
60-
displayName: Push NuGet package to Azure Artifacts
61-
inputs:
62-
command: push
63-
nuGetFeedType: external
64-
allowPackageConflicts: true
65-
packagesToPush:
66-
$(Build.ArtifactStagingDirectory)/*.nupkg
67-
$(Build.ArtifactStagingDirectory)/*.snupkg
68-
publishFeedCredentials: 'AzureArtifacts-$(System.TeamProject)'
69-
includeSymbols: true
64+
- template: azure-pipelines-templates/class-lib-package.yml@templates
65+
parameters:
66+
nugetPackageName: 'nanoFramework.Logging.Syslog'
7067

71-
- task: NuGetCommand@2
72-
condition: and( succeeded(), ne( variables['StartReleaseCandidate'], true ) )
73-
continueOnError: true
74-
displayName: Push NuGet packages to Nuget
75-
inputs:
76-
command: push
77-
nuGetFeedType: external
78-
allowPackageConflicts: true
79-
packagesToPush:
80-
$(Build.ArtifactStagingDirectory)/*.nupkg
81-
$(Build.ArtifactStagingDirectory)/*.snupkg
82-
publishFeedCredentials: 'NuGet-$(System.TeamProject)'
83-
includeSymbols: true
68+
- template: azure-pipelines-templates/class-lib-publish.yml@templates
8469

8570
# create or update GitHub release
8671
- task: GithubRelease@1
87-
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
72+
condition: >-
73+
and(
74+
succeeded(),
75+
eq(variables['System.PullRequest.PullRequestId'], ''),
76+
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
77+
ne(variables['StartReleaseCandidate'], true)
78+
)
8879
displayName: Create/Update GitHub PREVIEW release
8980
inputs:
9081
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
9182
tagSource: userSpecifiedTag
9283
tag: v$(MY_NUGET_VERSION)
9384
title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
9485
releaseNotesSource: inline
95-
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 (Serial API only)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Serial API only)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
86+
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 (Serial API only)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Stream API only)](https://www.nuget.org/packages/nanoFramework.Logging.Stream/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Syslog API only)](https://www.nuget.org/packages/nanoFramework.Logging.Syslog/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
9687
assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg'
9788
assetUploadMode: replace
9889
isPreRelease: true
9990
addChangeLog: false
10091

10192
# create or update GitHub release ON tags from release or main branches
10293
- task: GithubRelease@1
103-
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], 'preview') ), ne( variables['StartReleaseCandidate'], true ) )
94+
condition: >-
95+
and(
96+
succeeded(),
97+
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
98+
not(contains(variables['Build.SourceBranch'], 'preview')),
99+
ne(variables['StartReleaseCandidate'], true)
100+
)
104101
displayName: Create/Update GitHub stable release
105102
inputs:
106103
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
107104
tagSource: userSpecifiedTag
108105
tag: v$(MY_NUGET_VERSION)
109106
title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
110107
releaseNotesSource: inline
111-
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 (Stream API only)](https://www.nuget.org/packages/nanoFramework.Logging.Stream/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Serial API only)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
108+
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 (Stream API only)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Stream API only)](https://www.nuget.org/packages/nanoFramework.Logging.Stream/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (Syslog API only)](https://www.nuget.org/packages/nanoFramework.Logging.Syslog/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
112109
assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg'
113110
assetUploadMode: replace
114111
isPreRelease: false

0 commit comments

Comments
 (0)