-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (59 loc) · 1.66 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
# azure-pipelines.yml - configuration for Azure Pipelines
# Copyright (C) 2020 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
---
variables:
distName: redirect-script-4.0.0
trigger:
- master
- release/*
stages:
- stage: Default
jobs:
- job: Build
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: ~8
- bash: |
npm install
displayName: Install
- bash: |
npm test
displayName: Test
- task: PublishTestResults@2
condition: succeededOrFailed()
- bash: |
npm pack || exit $?
mkdir -p _dist
mv -f '$(distName)'.* _dist/
displayName: Make package archive
- publish: _dist
artifact: dist
- stage: Release
dependsOn: Default
condition:
and(succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
jobs:
- job: Upload
pool:
vmImage: ubuntu-latest
steps:
- download: current
artifact: dist
- task: NodeTool@0
inputs:
versionSpec: ~8
- task: npmAuthenticate@0
inputs:
workingFile: .npmrc
customEndpoint: npmjs
- bash: |
npm publish $(Agent.BuildDirectory)/dist/$(distName).tgz
displayName: Upload