Skip to content

Commit

Permalink
Fix condition (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-zaytsev authored Jun 28, 2023
1 parent 4e7fd28 commit 5d14692
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
trigger:
- master
- releases/*

variables:
isMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')]
Expand All @@ -11,6 +15,11 @@ parameters:
type: object
default: ['windows-latest', 'ubuntu-latest']

- name: publishToNpm
displayName: Publish to npm
type: boolean
default: false

stages:
- stage: Build
displayName: Build typed-rest-client
Expand Down Expand Up @@ -72,7 +81,7 @@ stages:
displayName: npm run test

- stage: Publish
condition: or(eq(variables.isRelease, true), eq(variables.isMaster, true))
condition: and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true)))
jobs:
- job: Publish_package
displayName: Publish npm package
Expand All @@ -92,4 +101,4 @@ stages:
workingDir: '_build'
publishRegistry: useExternalRegistry
publishEndpoint: NPM-Automation-Token
continueOnError: true
continueOnError: true

0 comments on commit 5d14692

Please sign in to comment.