autorest/.scripts/publish.yaml

47 строки
1.4 KiB
YAML

# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- v2
extends:
template: /eng/pipelines/templates/1es-redirect.yml
parameters:
stages:
- stage: Publish_Stage
variables:
- template: /eng/pipelines/templates/variables/image.yml
jobs:
- job:
displayName: NPM Publishing
pool:
name: $(LINUXNEXTPOOL)
image: $(LINUXNEXTVMIMAGE)
os: linux
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -g publish-release@1.6.1
# npm install
npm install
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# build packages
npm run publish-preview
# publish autorest core to a github release.
v=`dir src/autorest-core/*.tgz | sed 's/.*\(2\.0\..*\)\.tgz/\1/g'`
publish-release --token $(azuresdk-github-pat) --repo autorest --owner azure --name autorest-core-$v --tag autorest-core-$v --notes='v2 prerelease build' --prerelease --editRelease false --assets ./src/autorest-core/microsoft.azure-autorest-core-$v.tgz --target_commitish $(Build.SourceBranchName)
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
cd ..