piral-cli-dotenv
Version:
Extends the Piral CLI command options to automatically include dotenv files.
36 lines (29 loc) • 786 B
YAML
trigger:
branches:
include:
- main
- develop
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '22.5.1'
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'))