Skip to content

Commit efde24b

Browse files
author
Maxim Zaytsev
authored
Fix pipelines (#1040)
* Fix pipelines * Fix DotNetCoreCLI step
1 parent 9abb170 commit efde24b

3 files changed

+49
-49
lines changed

azure-pipelines-steps-node.yml

+43-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,49 @@
11
parameters:
2-
- name: nodeVersion
2+
- name: os
33
type: string
44

55
steps:
6-
# npm install
7-
- task: Npm@1
8-
displayName: npm install
9-
inputs:
10-
command: install
11-
workingDir: node
12-
136
- task: NodeTool@0
14-
displayName: use node ${{parameters.nodeVersion}}
7+
displayName: use node $(nodeVersion)
158
inputs:
16-
versionSpec: ${{parameters.nodeVersion}}
9+
versionSpec: $(nodeVersion)
10+
11+
- script: npm ci
12+
displayName: (task-lib) npm ci
13+
workingDirectory: node
14+
15+
- script: npm test
16+
workingDirectory: node
17+
displayName: (task-lib) npm test
18+
19+
# Only on Linux. For CI runs on master, automatically publish packages
20+
- ${{ if eq(parameters.os, 'Linux') }}:
21+
- bash: |
22+
echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc
23+
npm publish || true # Ignore publish failures, usually will happen because package already exists
24+
displayName: (task-lib) npm publish
25+
workingDirectory: node/_build
26+
condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master'))
27+
env:
28+
NPM_TOKEN: $(npm-automation.token)
29+
30+
# PublishPipelineArtifact step is configured in the base template.
31+
# See the templateContext section in the azure-pipelines.yml file
32+
33+
# Only on Windows. Build VstsTaskSdk for powershell
34+
- ${{ if eq(parameters.os, 'Windows_NT') }}:
35+
# Build step for .NET source code. This is needed to enable CodeQL for C# code
36+
- task: DotNetCoreCLI@2
37+
displayName: 'Build .NET project(s)'
38+
inputs:
39+
command: build
40+
projects: 'powershell/CompiledHelpers/VstsTaskSdk.csproj'
41+
arguments: '--configuration Release'
42+
43+
- script: npm ci
44+
displayName: (VstsTaskSdk) npm ci
45+
workingDirectory: powershell
46+
47+
- script: npm test
48+
displayName: (VstsTaskSdk) npm test
49+
workingDirectory: powershell

azure-pipelines-steps-test-build.yml

-10
This file was deleted.

azure-pipelines.yml

+6-29
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ trigger:
77
- releases/*
88

99
variables:
10-
- group: npm-tokens
11-
- name: nodeVersion
12-
value: '16.13.0'
10+
- group: npm-tokens
11+
- name: nodeVersion
12+
value: '16.13.0'
1313

1414
resources:
1515
repositories:
@@ -38,28 +38,18 @@ extends:
3838
#################################################
3939
- job: windows
4040
#################################################
41-
displayName: windows
4241
pool:
4342
name: 1ES-ABTT-Shared-Pool
4443
image: abtt-windows-2022
4544
os: windows
4645
steps:
4746
- template: /azure-pipelines-steps-node.yml@self
4847
parameters:
49-
nodeVersion: $(nodeVersion)
50-
- template: /azure-pipelines-steps-test-build.yml@self
51-
52-
- task: DotNetCoreCLI@2
53-
displayName: 'Build .NET project(s)'
54-
inputs:
55-
command: build
56-
projects: '**/*.csproj'
57-
arguments: '--configuration Release'
48+
os: Windows_NT
5849

5950
#################################################
6051
- job: linux
6152
#################################################
62-
displayName: Linux
6353
pool:
6454
name: 1ES-ABTT-Shared-Pool
6555
image: abtt-ubuntu-2204
@@ -73,29 +63,16 @@ extends:
7363
steps:
7464
- template: /azure-pipelines-steps-node.yml@self
7565
parameters:
76-
nodeVersion: $(nodeVersion)
77-
- template: /azure-pipelines-steps-test-build.yml@self
78-
# For CI runs on master, automatically publish packages
79-
- bash: |
80-
echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc
81-
npm publish || true # Ignore publish failures, usually will happen because package already exists
82-
displayName: npm publish
83-
workingDirectory: node/_build
84-
condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master'))
85-
env:
86-
NPM_TOKEN: $(npm-automation.token)
66+
os: Linux
8767

8868
#################################################
8969
- job: macOS
9070
#################################################
91-
displayName: macOS
9271
pool:
9372
name: Azure Pipelines
9473
image: macOS-latest
9574
os: macOS
9675
steps:
9776
- template: /azure-pipelines-steps-node.yml@self
9877
parameters:
99-
nodeVersion: $(nodeVersion)
100-
101-
- template: /azure-pipelines-steps-test-build.yml@self
78+
os: Darwin

0 commit comments

Comments
 (0)