Skip to content

Commit

Permalink
Fix pipelines (#1040)
Browse files Browse the repository at this point in the history
* Fix pipelines

* Fix DotNetCoreCLI step
  • Loading branch information
max-zaytsev authored May 22, 2024
1 parent 9abb170 commit efde24b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
53 changes: 43 additions & 10 deletions azure-pipelines-steps-node.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
parameters:
- name: nodeVersion
- name: os
type: string

steps:
# npm install
- task: Npm@1
displayName: npm install
inputs:
command: install
workingDir: node

- task: NodeTool@0
displayName: use node ${{parameters.nodeVersion}}
displayName: use node $(nodeVersion)
inputs:
versionSpec: ${{parameters.nodeVersion}}
versionSpec: $(nodeVersion)

- script: npm ci
displayName: (task-lib) npm ci
workingDirectory: node

- script: npm test
workingDirectory: node
displayName: (task-lib) npm test

# Only on Linux. For CI runs on master, automatically publish packages
- ${{ if eq(parameters.os, 'Linux') }}:
- bash: |
echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc
npm publish || true # Ignore publish failures, usually will happen because package already exists
displayName: (task-lib) 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: $(npm-automation.token)
# PublishPipelineArtifact step is configured in the base template.
# See the templateContext section in the azure-pipelines.yml file

# Only on Windows. Build VstsTaskSdk for powershell
- ${{ if eq(parameters.os, 'Windows_NT') }}:
# Build step for .NET source code. This is needed to enable CodeQL for C# code
- task: DotNetCoreCLI@2
displayName: 'Build .NET project(s)'
inputs:
command: build
projects: 'powershell/CompiledHelpers/VstsTaskSdk.csproj'
arguments: '--configuration Release'

- script: npm ci
displayName: (VstsTaskSdk) npm ci
workingDirectory: powershell

- script: npm test
displayName: (VstsTaskSdk) npm test
workingDirectory: powershell
10 changes: 0 additions & 10 deletions azure-pipelines-steps-test-build.yml

This file was deleted.

35 changes: 6 additions & 29 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ trigger:
- releases/*

variables:
- group: npm-tokens
- name: nodeVersion
value: '16.13.0'
- group: npm-tokens
- name: nodeVersion
value: '16.13.0'

resources:
repositories:
Expand Down Expand Up @@ -38,28 +38,18 @@ extends:
#################################################
- job: windows
#################################################
displayName: windows
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-windows-2022
os: windows
steps:
- template: /azure-pipelines-steps-node.yml@self
parameters:
nodeVersion: $(nodeVersion)
- template: /azure-pipelines-steps-test-build.yml@self

- task: DotNetCoreCLI@2
displayName: 'Build .NET project(s)'
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration Release'
os: Windows_NT

#################################################
- job: linux
#################################################
displayName: Linux
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-ubuntu-2204
Expand All @@ -73,29 +63,16 @@ extends:
steps:
- template: /azure-pipelines-steps-node.yml@self
parameters:
nodeVersion: $(nodeVersion)
- template: /azure-pipelines-steps-test-build.yml@self
# For CI runs on master, automatically publish packages
- bash: |
echo //registry.npmjs.org/:_authToken=\${NPM_TOKEN} > .npmrc
npm publish || true # Ignore publish failures, usually will happen because package already exists
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: $(npm-automation.token)
os: Linux

#################################################
- job: macOS
#################################################
displayName: macOS
pool:
name: Azure Pipelines
image: macOS-latest
os: macOS
steps:
- template: /azure-pipelines-steps-node.yml@self
parameters:
nodeVersion: $(nodeVersion)

- template: /azure-pipelines-steps-test-build.yml@self
os: Darwin

0 comments on commit efde24b

Please sign in to comment.