Skip to content

Commit

Permalink
ci: change to github release command to get better changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkurSheel committed Nov 24, 2021
1 parent a42124f commit 4d5ae28
Showing 1 changed file with 51 additions and 56 deletions.
107 changes: 51 additions & 56 deletions ci/azure-pipelines.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,54 @@ parameters:
message: ''

jobs:
- job: Build

pool:
vmImage: 'windows-latest'

steps:
- checkout: self
lfs: false

- script: dotnet test --logger trx
displayName: Run tests

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'

- task: NuGetToolInstaller@1

- script: dotnet tool restore
displayName: Install GitVersion

- script: dotnet dotnet-gitversion -l console -output buildserver -nofetch
displayName: Get Build Version

- script:
dotnet build $(libraryProject) --configuration $(buildConfiguration)
/p:Version=$(GitVersion.NuGetVersionV2)
displayName: Build Library

- script:
dotnet pack $(libraryProject) --configuration $(buildConfiguration) --include-symbols --no-build
--output $(Build.ArtifactStagingDirectory) /p:Version=$(GitVersion.NuGetVersionV2)
displayName: Build Nuget Package

- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Nuget ServiceConnection'

- task: GitHubRelease@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
gitHubConnection: 'github.com_AnkurSheel'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(GitVersion.NuGetVersionV2)'
title: 'v$(GitVersion.NuGetVersionV2)'
releaseNotesFilePath: 'CHANGELOG.md'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'issueBased'
- job: Build

pool:
vmImage: 'windows-latest'

steps:
- checkout: self
lfs: false

- script: dotnet test --logger trx
displayName: Run tests

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'

- task: NuGetToolInstaller@1

- script: dotnet tool restore
displayName: Install GitVersion

- script: dotnet dotnet-gitversion -l console -output buildserver -nofetch
displayName: Get Build Version

- script: dotnet build $(libraryProject) --configuration $(buildConfiguration) /p:Version=$(GitVersion.NuGetVersionV2)
displayName: Build Library

- script: dotnet pack $(libraryProject) --configuration $(buildConfiguration) --include-symbols --no-build --output $(Build.ArtifactStagingDirectory) /p:Version=$(GitVersion.NuGetVersionV2)
displayName: Build Nuget Package

- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Nuget ServiceConnection'

- task: GitHubRelease@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
gitHubConnection: 'github.com_AnkurSheel'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(GitVersion.NuGetVersionV2)'
title: 'v$(GitVersion.NuGetVersionV2)'
compareWith: 'lastFullRelease'
addChangelog: true

0 comments on commit 4d5ae28

Please sign in to comment.