Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 96 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,114 @@ jobs:
steps:

# step from template @ nf-tools repo
# all build, update and publish steps
- template: azure-pipelines-templates/class-lib-build.yml@templates

# build steps only
- template: azure-pipelines-templates/class-lib-build-only.yml@templates
parameters:
sonarCloudProject: 'nanoframework_lib-CoreLibrary'
msbuildExtraParams: '/p:DefineConstants="NANOCLR_REFLECTION"'

##############################
- job: Build_mscorlib_no_reflection
condition: eq(variables['UPDATE_DEPENDENTS'], 'false')
pool:
vmImage: 'VS2017-Win2016'

variables:
solution: '**/source/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
nugetPackageName: 'nanoFramework.CoreLibrary.NoReflection'
repoName: 'lib-CoreLibrary'

steps:
# package steps
- template: azure-pipelines-templates/class-lib-package.yml@templates
parameters:
nugetPackageName: 'nanoFramework.CoreLibrary'

# step from template @ nf-tools repo
# all build, update and publish steps
- template: azure-pipelines-templates/class-lib-build.yml@templates
- template: azure-pipelines-templates/class-lib-package.yml@templates
parameters:
sonarCloudProject: 'nanoframework_lib-CoreLibrary.NoReflection'
nugetPackageName: 'nanoFramework.CoreLibrary.NoReflection'

- template: azure-pipelines-templates/class-lib-publish.yml@templates

# need to push the other package to NuGet because the template above can only push one package (happens on tag builds for any branch)
- task: NuGetCommand@2
inputs:
command: push
nuGetFeedType: external
allowPackageConflicts: true
packagesToPush:
$(Build.ArtifactStagingDirectory)/nanoFramework.CoreLibrary.NoReflection.$(MY_NUGET_VERSION).nupkg
publishFeedCredentials: 'AzureArtifacts-CoreLibrary'
condition: and( succeeded(), ne( variables['StartReleaseCandidate'], true ) )
continueOnError: true
displayName: Push "NoReflection" variant NuGet package to Azure Artifacts

- task: NuGetCommand@2
inputs:
command: push
nuGetFeedType: external
allowPackageConflicts: true
packagesToPush:
$(Build.ArtifactStagingDirectory)/nanoFramework.CoreLibrary.NoReflection.$(MY_NUGET_VERSION).nupkg
publishFeedCredentials: 'NuGet-CoreLibrary'
condition: and( succeeded(), ne( variables['StartReleaseCandidate'], true ) )
continueOnError: true
displayName: Push "NoReflection" variant NuGet package to Azure Artifacts

# create or update GitHub release
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: 'nanoframework'
githubOwner: 'nanoframework'
githubRepositoryName: $(repoName)
githubTag: v$(MY_NUGET_VERSION)
githubReleaseTitle: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br><h4>Install from nanoFramework Azure Artifacts development feed</h4><br>The following NuGet packages are available for download from this release:<br>:package: [.NET](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&view=overview&package=$(nugetPackageName)&protocolType=NuGet&version=$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)<br>:package: [.NET (without Reflection)](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&view=overview&package=$(nugetPackageName).NoReflection&protocolType=NuGet&version=$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)'
githubTargetCommitsh: $(Build.SourceVersion)
githubReleaseDraft: $(RELEASE_DRAFT)
githubReleasePrerelease: true
githubReuseDraftOnly: false
githubReuseRelease: true
githubEditRelease: true
githubDeleteEmptyTag: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
displayName: Create/Update GitHub release

# create or update GitHub release ON tags from release or master branches
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: 'nanoframework'
githubOwner: 'nanoframework'
githubRepositoryName: $(repoName)
githubTag: v$(MY_NUGET_VERSION)
githubReleaseTitle: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
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)'
githubTargetCommitsh: $(Build.SourceVersion)
githubReleaseDraft: $(RELEASE_DRAFT)
githubReleasePrerelease: true
githubReuseDraftOnly: false
githubReuseRelease: true
githubEditRelease: true
githubDeleteEmptyTag: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), contains(variables['Build.SourceBranch'], 'preview') )
displayName: Create/Update GitHub PREVIEW release

# create or update GitHub release ON tags from release or master branches
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: 'nanoframework'
githubOwner: 'nanoframework'
githubRepositoryName: $(repoName)
githubTag: v$(MY_NUGET_VERSION)
githubReleaseTitle: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)'
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)'
githubTargetCommitsh: $(Build.SourceVersion)
githubReleaseDraft: false
githubReleasePrerelease: false
githubReuseDraftOnly: false
githubReuseRelease: false
githubEditRelease: false
githubDeleteEmptyTag: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], 'preview') ) )
displayName: Create/Update GitHub stable release

##############################
- job: Update_Dependencies
condition: and( ne( variables['StartReleaseCandidate'], true ), eq(variables['UPDATE_DEPENDENTS'], true) )

dependsOn:
- Build_mscorlib
- Build_mscorlib_no_reflection

pool:
vmImage: 'VS2017-Win2016'
Expand Down Expand Up @@ -126,7 +200,6 @@ jobs:

dependsOn:
- Build_mscorlib
- Build_mscorlib_no_reflection
- Update_Dependencies
condition: or( failed('Build_mscorlib'), failed('Build_mscorlib_no_reflection'), failed('Update_Dependencies'))

Expand Down
Loading