diff --git a/azure-pipelines-steps-node.yml b/azure-pipelines-steps-node.yml index 8e2591383..a7444bfb8 100644 --- a/azure-pipelines-steps-node.yml +++ b/azure-pipelines-steps-node.yml @@ -4,13 +4,13 @@ parameters: steps: # npm install - - task: Npm@1 - displayName: (azure-pipelines-task-lib) npm install - inputs: - command: install - workingDir: node +- task: Npm@1 + displayName: npm install + inputs: + command: install + workingDir: node - - task: NodeTool@0 - displayName: (azure-pipelines-task-lib) use node ${{parameters.nodeVersion}} - inputs: - versionSpec: ${{parameters.nodeVersion}} +- task: NodeTool@0 + displayName: use node ${{parameters.nodeVersion}} + inputs: + versionSpec: ${{parameters.nodeVersion}} diff --git a/azure-pipelines-steps-test-build.yml b/azure-pipelines-steps-test-build.yml index 38ca9e3e9..0789bb88a 100644 --- a/azure-pipelines-steps-test-build.yml +++ b/azure-pipelines-steps-test-build.yml @@ -1,10 +1,10 @@ steps: # test - - script: node make.js test - workingDirectory: node - displayName: (azure-pipelines-task-lib) node make.js test +- script: node make.js test + workingDirectory: node + displayName: node make.js test # build - - script: node make.js build - displayName: (azure-pipelines-task-lib) node make.js build - workingDirectory: node +- script: node make.js build + displayName: node make.js build + workingDirectory: node diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9bafc145f..42914e225 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,8 +4,10 @@ trigger: - releases/* variables: - nodeVersion: 10.23.0 - +- group: npm-tokens +- name: nodeVersion + value: '10.23.0' + jobs: ################################################# - job: windows @@ -15,44 +17,11 @@ jobs: vmImage: windows-2019 steps: - ################################################################################ - # azure-pipelines-task-lib - ################################################################################ - - template: azure-pipelines-steps-node.yml parameters: nodeVersion: $(nodeVersion) - - # test - - script: | - chcp 437 - node make.js test - workingDirectory: node - displayName: (azure-pipelines-task-lib) node make.js test - - # build - - script: | - chcp 437 - node make.js build - displayName: (azure-pipelines-task-lib) node make.js build - workingDirectory: node - - ################################################################################ - # VstsTaskSdk - ################################################################################ - - # npm install - - task: Npm@1 - displayName: (VstsTaskSdk) npm install - inputs: - command: install - workingDir: powershell - - # npm test - - script: npm test - displayName: (VstsTaskSdk) npm test - workingDirectory: powershell - + - template: azure-pipelines-steps-test-build.yml + ################################################# - job: linux ################################################# @@ -74,14 +43,13 @@ jobs: # For CI runs on master, automatically publish packages - bash: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc - cd _build + echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc npm publish || true # Ignore publish failures, usually will happen because package already exists - displayName: (azure-pipelines-task-lib) npm publish - workingDirectory: node - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'master', 'releases/3.x')) + displayName: npm publish + workingDirectory: node/_build + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master')) env: - NPM_TOKEN: $(npmPublishToken) + NPM_TOKEN: $(npm-automation.token) ################################################# - job: macOS @@ -94,4 +62,4 @@ jobs: - template: azure-pipelines-steps-node.yml parameters: nodeVersion: $(nodeVersion) - - template: azure-pipelines-steps-test-build.yml + - template: azure-pipelines-steps-test-build.yml \ No newline at end of file