2022-02-18 03:02:36 +03:00
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
2020-11-06 16:15:40 +03:00
trigger :
branches :
2022-02-18 03:02:36 +03:00
include :
- main
- develop
- release-*
2020-11-06 16:15:40 +03:00
paths :
2022-02-18 03:02:36 +03:00
exclude :
- .github_changelog_generator
- .gitignore
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- LICENSE.md
- README.md
- NuGet.Config
- assets/*
- config/*
- .github/*
2020-11-06 16:15:40 +03:00
# PR always trigger build
2021-11-25 15:07:11 +03:00
pr :
autoCancel : true
2020-10-25 10:33:31 +03:00
# add nf-tools repo to resources (for Azure Pipelines templates)
resources :
repositories :
- repository : templates
type : github
name : nanoframework/nf-tools
2020-11-06 16:15:40 +03:00
endpoint : nanoframework
2020-10-25 10:33:31 +03:00
pool :
2022-02-18 03:02:36 +03:00
vmImage : 'windows-latest'
2020-10-25 10:33:31 +03:00
variables :
2024-01-20 21:02:01 +03:00
- group : sign-client-credentials
- name : DOTNET_NOLOGO
value : true
- name : buildPlatform
value : 'Any CPU'
- name : buildConfiguration
value : 'Release'
- name : solution
value : 'nanoFramework.WebServer.sln'
- name : nugetPackageName
value : 'nanoFramework.WebServer'
2020-10-25 10:33:31 +03:00
steps :
2020-11-06 16:15:40 +03:00
# step from template @ nf-tools repo
# all build, update and publish steps
2023-10-25 15:58:28 +03:00
- template : azure-pipelines-templates/class-lib-build-only.yml@templates
2020-11-06 16:15:40 +03:00
parameters :
sonarCloudProject : 'nanoframework_lib-nanoframework.WebServer'
2020-10-25 10:33:31 +03:00
2023-10-25 15:58:28 +03:00
# build the 2 libs step
- template : azure-pipelines-templates/class-lib-package.yml@templates
parameters :
nugetPackageName : 'nanoFramework.WebServer'
- template : azure-pipelines-templates/class-lib-package.yml@templates
parameters :
nugetPackageName : 'nanoFramework.WebServer.FileSystem'
# publish the 2 libs
- template : azure-pipelines-templates/class-lib-publish.yml@templates
# create GitHub release build from main branch
- task : GithubRelease@1
condition : >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
startsWith(variables['Build.SourceBranch'], 'refs/heads/main'),
not(contains(variables['Build.SourceBranch'], 'preview')),
eq(variables['StartReleaseCandidate'], false)
)
displayName : Create/Update GitHub release
inputs :
action : edit
gitHubConnection : 'github.com_nano-$(System.TeamProject)'
tagSource : userSpecifiedTag
tag : v$(MY_NUGET_VERSION)
title : '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
releaseNotesSource : inline
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: [nanoFramework.WebServer](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).<br>:package : [ nanoFramework.WebServer.FileSystem (requires support of storage through System.IO.FileSystem)](https://www.nuget.org/packages/nanoFramework.WebServer.FileSystem/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
assets : '$(Build.ArtifactStagingDirectory)/*.nupkg'
assetUploadMode : replace
isPreRelease : false
addChangeLog : false
2020-11-06 16:15:40 +03:00
# step from template @ nf-tools repo
# report error
- template : azure-pipelines-templates/discord-webhook-task.yml@templates
parameters :
status : 'failure'
webhookUrl : '$(DiscordWebhook)'
message : ''