|
1 | 1 | trigger: |
2 | 2 | branches: |
3 | | - include: [main, develop, "release-*" ] |
| 3 | + include: |
| 4 | + - main |
| 5 | + - develop |
| 6 | + - release-* |
4 | 7 | 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 |
6 | 16 | tags: |
7 | 17 | include: ["v*"] |
8 | 18 |
|
@@ -51,64 +61,51 @@ steps: |
51 | 61 | parameters: |
52 | 62 | nugetPackageName: 'nanoFramework.Logging.Stream' |
53 | 63 |
|
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' |
70 | 67 |
|
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 |
84 | 69 |
|
85 | 70 | # create or update GitHub release |
86 | 71 | - 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 | + ) |
88 | 79 | displayName: Create/Update GitHub PREVIEW release |
89 | 80 | inputs: |
90 | 81 | gitHubConnection: 'github.com_nano-$(System.TeamProject)' |
91 | 82 | tagSource: userSpecifiedTag |
92 | 83 | tag: v$(MY_NUGET_VERSION) |
93 | 84 | title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)' |
94 | 85 | 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)' |
96 | 87 | assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg' |
97 | 88 | assetUploadMode: replace |
98 | 89 | isPreRelease: true |
99 | 90 | addChangeLog: false |
100 | 91 |
|
101 | 92 | # create or update GitHub release ON tags from release or main branches |
102 | 93 | - 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 | + ) |
104 | 101 | displayName: Create/Update GitHub stable release |
105 | 102 | inputs: |
106 | 103 | gitHubConnection: 'github.com_nano-$(System.TeamProject)' |
107 | 104 | tagSource: userSpecifiedTag |
108 | 105 | tag: v$(MY_NUGET_VERSION) |
109 | 106 | title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)' |
110 | 107 | 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)' |
112 | 109 | assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg' |
113 | 110 | assetUploadMode: replace |
114 | 111 | isPreRelease: false |
|
0 commit comments