sample-pilet-service
Version:
Piral: Sample pilet feed service.
36 lines (29 loc) • 784 B
YAML
trigger:
branches:
include:
- main
- develop
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- script: |
sed -i -e "s/\(\"version\":\\s\+\"\([0-9]\+\.\?\)\+\)/\1-pre.$BUILD_BUILDNUMBER/" package.json;
displayName: 'Preview version'
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
- script: |
npm pack
displayName: 'npm pack'
- task: Npm@1
inputs:
command: publish
publishEndpoint: 'NPM connection 1'
displayName: 'Publish package'
condition: and(succeeded(), in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/develop'))