forked from iamvishnusankar/next-sitemap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipeline.yml
105 lines (93 loc) · 2.5 KB
/
azure-pipeline.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
name: 4.3$(rev:.r)
trigger:
branches:
include:
- master
pool:
vmImage: 'ubuntu-latest'
demands: npm
steps:
# Setup Node
- task: UseNode@1
displayName: Setup Node
inputs:
version: '20.x'
# Set yarn version
# - task: Bash@3
# displayName: 'Set yarn version'
# inputs:
# targetType: 'inline'
# script: 'yarn set version stable'
# Authenticate
- task: npmAuthenticate@0
displayName: NPM Auth
inputs:
workingFile: .npmrc
customEndpoint: 'NPM(Vishnu Sankar)'
# Set Version
- task: Bash@3
displayName: 'Set Version'
inputs:
targetType: 'inline'
script: yarn workspaces foreach version $BUILD_BUILDNUMBER
# failOnStderr: true
# Install
- task: Bash@3
displayName: 'Install'
inputs:
targetType: 'inline'
script: 'yarn install'
# Test
- task: Bash@3
displayName: 'Test'
inputs:
targetType: 'inline'
script: 'yarn test --ci'
# Build
- task: Bash@3
displayName: 'Build'
inputs:
targetType: 'inline'
script: 'yarn workspace next-sitemap build && yarn workspace next-sitemap postbuild'
# Copy README
- task: Bash@3
displayName: 'Copy README'
inputs:
targetType: 'inline'
script: 'cp README.md packages/next-sitemap/README.md'
failOnStderr: true
# Test Result
- task: PublishTestResults@2
displayName: Publish Test Result
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'junit.xml'
failTaskOnFailedTests: true
# Coverage Result
- task: PublishCodeCoverageResults@1
displayName: Publish Coverage Result
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'coverage/cobertura-coverage.xml'
failIfCoverageEmpty: true
# Publish Packages
- task: Bash@3
displayName: 'Publish Packages'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
targetType: 'inline'
script: 'npm publish --w=next-sitemap'
# failOnStderr: true
# Github Release
- task: GitHubRelease@1
displayName: Github Release
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: 'iamvishnusankar'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(Build.BuildNumber)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'