name: $(Date:yyyyMMdd)$(Rev:.r)

trigger:
  batch: true
  branches:
    include:
      - main
pr: none

resources:
  repositories:
    - repository: templates
      type: github
      name: microsoft/vscode-engineering
      ref: main
      endpoint: Monaco

parameters:
  - name: publishPackage
    displayName: Publish vscode-markdown-languageserver
    type: boolean
    default: false

extends:
  template: azure-pipelines/npm-package/pipeline.yml@templates
  parameters:
    npmPackages:
      - name: vscode-markdown-languageserver

        buildSteps:
          - script: npm install
            displayName: Install dependencies

          - script: npm run compile
            displayName: Compile

          - script: npm run api-extractor
            displayName: API Extractor

        testPlatforms:
          - name: Linux
            nodeVersions:
              - 16.x
          - name: MacOS
            nodeVersions:
              - 16.x
          - name: Windows
            nodeVersions:
              - 16.x

        testSteps:
          - script: npm install
            displayName: Install dependencies

          - script: npm run compile
            displayName: Compile

          - script: npm test
            displayName: Test npm package

        publishPackage: ${{ parameters.publishPackage }}
