trigger:
  - master
  - preview

variables:
  Codeql.Enabled: true

pr:
  - none

jobs:
  - job: Linux
    pool:
      vmImage: ubuntu-latest
    timeoutInMinutes: 20
    steps:
      - checkout: self
        clean: true
      - template: common-validation.yml

      - task: ComponentGovernanceComponentDetection@0
        displayName: "Component Detection"
        inputs:
          ignoreDirectories: ".vscode-test"

      - task: notice@0
        displayName: "NOTICE File Generator"
        inputs:
          outputfile: "ThirdPartyNotices_Generated.txt"
          additionaldata: release/AdditionalAttributions.txt

      - bash: gulp release
        displayName: "gulp release"

      - bash: 'node -e "console.log(require(''./package.json'').version)" -> version.txt'
        displayName: "Strip version from package.json and save to version.txt"

      - task: CopyFiles@2
        displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
        inputs:
          Contents: |
            *.vsix
            CHANGELOG.md
            version.txt
          TargetFolder: "$(Build.ArtifactStagingDirectory)"

      - task: PublishBuildArtifacts@1
        displayName: "Publish artifacts: drop-win"
        inputs:
          ArtifactName: "drop-win"

  - job: Windows
    pool:
      vmImage: windows-latest
    timeoutInMinutes: 20
    steps:
      - checkout: self
        clean: true
      - template: common-validation.yml

      - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
        displayName: "Component Detection"
        inputs:
          ignoreDirectories: ".vscode-test"

  - job: macOS
    pool:
      vmImage: macOS-latest
    timeoutInMinutes: 20
    steps:
      - checkout: self
        clean: true
      - template: common-validation.yml

      - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
        displayName: "Component Detection"
        inputs:
          ignoreDirectories: ".vscode-test"
