-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
71 lines (60 loc) · 1.75 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Trigger a build on version tags and push to nuget repository
trigger:
tags:
include:
- 'v*'
variables:
- group: "Nuget Publish"
- name: nugetApiKey
value: $[variables.NUGET_API_KEY]
pr:
branches:
exclude:
- '*'
jobs:
- job: buildMaster
displayName: Build Master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
displayName: Set VERSION_TAG environment variable
condition: startsWith(variables['build.sourceBranch'], 'refs/tags/v')
inputs:
targetType: inline
script: |
VERSION_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG"
- task: Assembly-Info-NetFramework@3
displayName: Patch Assembly Version
condition: startsWith(variables['build.sourceBranch'], 'refs/tags/v')
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: |
**/AssemblyInfo.cs
InsertAttributes: false
FileEncoding: 'auto'
WriteBOM: false
VersionNumber: '$(VERSION_TAG)'
FileVersionNumber: '$(VERSION_TAG)'
LogLevel: 'verbose'
FailOnWarning: true
DisableTelemetry: true
- task: Bash@3
displayName: 'Build Solution'
inputs:
filePath: 'build.sh'
arguments: '--target Build --configuration Release'
- task: Bash@3
displayName: 'Build Nuget Package'
inputs:
filePath: 'build.sh'
arguments: '--target Pack-Release --configuration Release'
- task: Bash@3
displayName: 'Publish Nuget Package'
inputs:
filePath: 'build.sh'
arguments: '--target Nuget-Push --configuration Release'
env:
NUGET_API_KEY: $(nugetApiKey)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: Shelly.Net