-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
119 lines (103 loc) · 3.24 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
branches:
include:
- main
pr:
- main
pool: 'contabo'
variables:
buildConfiguration: 'Release'
solutionName: 'semantic-release.sln'
stages:
- stage: Variables
jobs:
- job:
steps:
- script: |
echo $PATH
env | sort
- stage: Feature_branch
condition: ne(variables['System.PullRequest.SourceBranch'], '')
jobs:
- job: restore_solution
displayName: Restore solution
steps:
- script: dotnet restore $solutionName
- job: build_solution
displayName: Build solution
dependsOn: restore_solution
steps:
- script: dotnet build $solutionName
- job: test_solution
displayName: Test solution
dependsOn: build_solution
steps:
- script: dotnet test $solutionName
- stage: Main_branch
condition: and(eq(variables['System.PullRequest.SourceBranch'], ''), eq(variables['Build.SourceBranch'],'refs/heads/main'))
jobs:
- job: restore_solution
displayName: Restore solution
steps:
- script: dotnet restore $solutionName
- job: build_solution
dependsOn: restore_solution
displayName: Build solution
steps:
- script: dotnet build $solutionName
- job: test_solution
dependsOn: build_solution
displayName: Test solution
steps:
- script: dotnet test $solutionName
- job: install_semantic
dependsOn: test_solution
displayName: Install Semantic
steps:
- script: |
echo '##vso[task.prependpath]$(HOME)/.local/bin'
displayName: PATH
- script: |
npm install npm@6
displayName: npm@6
- script: |
npm install semantic-release
displayName: semantic-release
- script: |
npm install @semantic-release/changelog
displayName: semantic-release/changelog
- script: |
npm install @semantic-release/exec
displayName: semantic-release/exec
- script: |
npm install @semantic-release/git
displayName: semantic-release/git
- script: |
npm install @semantic-release/github
displayName: semantic-release/github
- script: |
pip3 install --user bump2version
displayName: bump2version
- job: semantic_release
dependsOn: install_semantic
displayName: Semantic Release
steps:
- script: |
echo '##vso[task.prependpath]$(HOME)/.local/bin'
displayName: PATH
- script: |
npx semantic-release
displayName: semantic-release
env:
GH_TOKEN: $(githubToken)
- job: release_build
dependsOn: semantic_release
displayName: Release build
steps:
- script: |
dotnet build $solutionName
displayName: Release build