greenshot/azure-pipelines.yml
2020-03-03 15:48:26 +01:00

100 lines
3.2 KiB
YAML

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
batch: true
branches:
include:
- 'release/1.*'
exclude:
- 'develop'
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: 'Windows-latest'
variables:
solution: 'Greenshot.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
group: 'Plug-in Credentials'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
command: 'restore'
restoreSolution: '$(solution)'
feedsToUse: config
- task: MSBuild@1
displayName: Generate templates
inputs:
solution: '$(solution)'
platform: $(buildPlatform)
configuration: $(buildConfiguration)
msbuildArguments: '/t:PrepareForBuild'
- task: MSBuild@1
displayName: Build and package
inputs:
solution: '$(solution)'
platform: $(buildPlatform)
configuration: $(buildConfiguration)
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\Greenshot\releases'
Contents: Greenshot-INSTALLER-*.exe
TargetFolder: '$(build.artifactstagingdirectory)'
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
- stage: Deploy
jobs:
- deployment: GitHub_Release
pool:
vmImage: 'Windows-latest'
environment: 'GitHub Release'
strategy:
# default deployment strategy
runOnce:
deploy:
steps:
- download: current
artifact: drop
# Create a GitHub release
- task: GitHubRelease@0
inputs:
gitHubConnection: GitHub Release
repositoryName: '$(Build.Repository.Name)'
action: 'create' # Options: create, edit, delete
target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit
tagSource: 'manual' # Required when action == Create# Options: auto, manual
tag: 'v$(Build.BuildNumber)' # Required when action == Edit || Action == Delete || TagSource == Manual
title: Greenshot $(Build.BuildNumber) unstable # Optional
#releaseNotesSource: 'file' # Optional. Options: file, input
#releaseNotesFile: # Optional
#releaseNotes: # Optional
assets: '$(Pipeline.Workspace)/drop/*.exe'
#assetUploadMode: 'delete' # Optional. Options: delete, replace
isDraft: true # Optional
isPreRelease: true # Optional
addChangeLog: true # Optional
#compareWith: 'lastFullRelease' # Required when addChangeLog == True. Options: lastFullRelease, lastRelease, lastReleaseByTag
#releaseTag: # Required when compareWith == LastReleaseByTag