Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publishToNpm parameter #360

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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