-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new pipeline file for publishing releases (#9)
add new pipeline file for publishing releases
- Loading branch information
Showing
3 changed files
with
117 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
steps: | ||
|
||
- task: UseDotNet@2 | ||
displayName: "Add dotnet core 2.1" | ||
inputs: | ||
version: 2.1.x | ||
packageType: sdk | ||
includePreviewVersions: false | ||
|
||
- task: UseDotNet@2 | ||
displayName: "Use dotnet core 3.1" | ||
inputs: | ||
version: 3.1.x | ||
packageType: sdk | ||
includePreviewVersions: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "Restore packages" | ||
inputs: | ||
command: "restore" | ||
projects: "HoneycombSerilogSink.sln" | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "Build" | ||
env: | ||
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER) | ||
BUILD_ID: $(BUILD.BUILDNUMBER) | ||
inputs: | ||
command: "build" | ||
projects: "HoneycombSerilogSink.sln" | ||
arguments: '-c $(buildConfiguration)' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Test' | ||
inputs: | ||
command: 'test' | ||
projects: 'HoneycombSerilogSink.sln' | ||
arguments: '--no-restore --no-build -c $(buildConfiguration) --collect "Code coverage"' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Package' | ||
env: | ||
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER) | ||
BUILD_ID: $(BUILD.BUILDNUMBER) | ||
inputs: | ||
command: 'pack' | ||
arguments: '.\src\Honeycomb.Serilog.Sink\Honeycomb.Serilog.Sink.csproj --output $(Build.ArtifactStagingDirectory) --configuration $(buildConfiguration) --no-build' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish built artifacts' | ||
env: | ||
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER) | ||
BUILD_ID: $(BUILD.BUILDNUMBER) | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
ArtifactName: 'nuget' | ||
publishLocation: 'Container' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Add steps that build, run tests, deploy, and more: | ||
# https://aka.ms/yaml | ||
|
||
trigger: | ||
tags: | ||
include: | ||
- "*" | ||
|
||
pr: none | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
steps: | ||
- pwsh: | | ||
[string]$latestTag=iex 'git describe --tags --abbrev=0' | ||
[string]$version="v$latestTag.$(BUILD.BUILDNUMBER)" | ||
Write-Output "##vso[task.setvariable variable=releaseTag]$latestTag" | ||
Write-Output "##vso[task.setvariable variable=version]$version" | ||
displayName: "Set buld task name" | ||
|
||
- template: ci/templates/build-and-package.yml | ||
|
||
- pwsh: | | ||
Write-Host "##vso[build.updatebuildnumber]$(latestTag)" | ||
- task: NuGetAuthenticate@0 | ||
inputs: | ||
nuGetServiceConnections: 'HoneycombSinkNugetFeed' | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'Push package to nuget' | ||
inputs: | ||
command: push | ||
nuGetFeedType: external | ||
publishFeedCredentials: HoneycombSinkNugetFeed | ||
|
||
- task: GitHubRelease@1 | ||
inputs: | ||
gitHubConnection: GithubServiceConnection | ||
repositoryName: '$(Build.Repository.Name)' | ||
action: 'edit' | ||
target: '$(Build.SourceVersion)' | ||
releaseNotesSource: 'inline' | ||
changeLogCompareToRelease: 'lastFullRelease' | ||
changeLogType: 'commitBased' | ||
tag: $(latestTag) |